Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting border to display within the td tag

 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best practice is to use a style sheet...
An Example:


Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic