This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Getting border to display within the td tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Getting border to display within the td tag" Watch "Getting border to display within the td tag" New topic
Author

Getting border to display within the td tag

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
I have tried to include a border to the within the <td> tags but I cant seem to get it to display. How would I do it using css?
<table width="740" height="24" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="140" height="24" bgcolor="FFFFFF" BORDERCOLOR="737995" border="1"><img src="greyarrow.gif" width="10" height="15"><a href="/index.asp">home</a></td>
<td width="10" height="24"> </td>
<td class="box1" width="140" height="24" bgcolor="FFFFFF" BORDERCOLOR="737995" border="1"><img src="greyarrow.gif" align="absmiddle" width="10" height="15"><a href="/aboutus.asp" class="link">about us</a></td>
<td width="10" height="24"> </td>
<td width="140" height="24" bgcolor="#FFFFFF"></td>
<td width="10" height="24"> </td>
<td width="140" height="24" bgcolor="#FFFFFF"></td>
</tr>
</table>
eammon bannon
Ranch Hand

Joined: Mar 16, 2004
Posts: 140
<td /> doesn't have a border attribute, in a table only <table /> does. If you want a visible border round certain cells, you could declare a border for the entiretable, and change the bordercolor attribute on each cell. But his is IE only.
CSS gives you a border style to use on any object, with width, style and color properties.
jyothsna kumari
Ranch Hand

Joined: Jul 21, 2003
Posts: 108
hi,
You cannot get the border for a td tag by simply specifying the border color.You have to use the style property.Use this code and adjust the color and width of the border.
<td style="BORDER-RIGHT: orange solid; BORDER-TOP: orange solid; BORDER-LEFT: orange solid; BORDER-BOTTOM: orange solid" width="140" height="24" bgcolor="FFFFFF" ><img src="greyarrow.gif" width="10" height="15"><a href="/index.asp">home</a></td>
Thanks,
Jyothsna
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
The best practice is to use a style sheet...
An Example:


Eric
 
 
subject: Getting border to display within the td tag
 
Similar Threads
tiles and <sx:autocompleter>
GET html contents from a web server
jsp:include and c:import combination/nesting
Why this problem???
JSP and XML