Learn HTML Code Tutorial Reference Guide

Table Borders: The Basics

The most basic issue concerning table borders is if there should be any borders at all. That issue is settled with the BORDER attribute to the <TABLE ...> tag.

By default, tables do not have borders. For example, this code, which does not have any attributes in the <TABLE ...> tag, produces a table with no borders:

<TABLE>
<TR> <TD>watermelon</TD> <TD>grapes</TD>  </TR>
<TR> <TD>peaches</TD>    <TD>bananas</TD> </TR>
</TABLE>

which gives us

watermelon grapes
peaches bananas

To give the table borders we add the BORDER attribute to the <TABLE ...> tag:

<TABLE BORDER>

which gives us this table

watermelon grapes
peaches bananas

BORDER sets the width of the outer border. So, for example, this code creates a table with an outside border width of 10:

<TABLE BORDER=10>

which gives us this table

watermelon grapes
peaches bananas

Note that BORDER sets the width of the outside border. The width of the inside borders are set with CELLSPACING.

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial