| <<< Home | << Web | < HTML Notes | Top | Bottom | < Prev | Next > |
|
Topics on this page:
The border attributeThe border attribute specifies the size of the border that goes around the table. If a non-zero border is specified, there will also be "rules" drawn between the cells. Here is an example:
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<td> Cell 1 </td>
<td> Cell 2 </td>
</tr>
<tr>
<td> Cell 3 </td>
<td> Cell 4 </td>
</tr>
</table>
The following snapshots show this table displayed with border="0", border="3" and border="9". On the left is Netscape 4.5. On the right is IE 3.
This example used cellspacing="0". Adding some space between the cells changes the look a bit. Here's the same example but with cellspacing="5":
The bordercolor Attributes
Netscape 4+ and IE 3+ recognize an attribute called bordercolor.
Here's the same table with
IE recognizes two additional attributes: bordercolorlight and bordercolordark. If both of these are included, IE ignores bordercolor. So you can include bordercolor for Netscape's benefit and the other two for IE's benefit.
<table border="0" cellpadding="5" cellspacing="5"
bordercolor="#ff0000"
bordercolorlight="#0000ff"
bordercolordark="#000077">
<tr>
<td> Cell 1 </td>
<td> Cell 2 </td>
</tr>
<tr>
<td> Cell 3 </td>
<td> Cell 4 </td>
</tr>
</table>
Netscape 3 bordersAlthough Netscape 3 does not support the border color attributes, it does base the color of the border on the page's background color. So if you're using a background image on the page, you can play with the bgcolor attribute in the <body> tag to get the border the color you like. Warning: some users surf with images turned off - so make sure that your page is still readable if the background image doesn't appear. |
| <<< Home | << Web | < HTML Notes | Top | Bottom | < Prev | Next > |