link to hitmill.com home page



HTML Table Tutorial:
Partial Borders Using the FRAME Attribute

First I would like to say that the FRAME attribute of the <TABLE> tag is in no way connected to HTML Frames. That is an altogether different topic. This FRAME attribute has to do with making partial borders around tables. First I will show you a table, then I will share the code, so you know to do it. (Some browsers will not yet support the frame attribute of the table tag.)


HSIDES means that the top and bottom horizontal borders will appear:


<TR VALIGN="top">

Note: When you code FRAME=HSIDES you need to still specify the BORDER width for the outer part and if you want a second fine line with it, you have to code CELLSPACING. The effect will not show up well on certain backgrounds unless you also code a BORDERCOLOR for your partial frame.


FRAME=VSIDES will render vertical frames on the left and right edges of the table:

<table frame="vsides" border="4" cellspacing="4" bgcolor="cornsilk" bordercolor="green" cellpadding="10">
<tr valign="top">
<td><div class="again" style="margin-left:0; margin-right:0">

See what happens now if we add more than one cell to a table that has vertical borders:

Row 1: Column 1 Row 1: Column 2
Row 2: Column 1 Row 2: Column2

The vertical borders lose their effectiveness, the table has become sloppy and looks like "something is missing". Adding a subtle background color would help to restore some cohesiveness to the table. Another thing to keep in mind is that not all browsers support the FRAME attribute of the TABLE tag.


Back to Table Attributes List
Table Tutorials Listed


Search Tutorial | Web Services
Top | News | Travel | Computers
Internet | HTML | Dynamic HTML | XML
Programming | JavaScript | ASP | Home


Updated 11 April 2006
© hitmill.com
All Rights Reserved