HTML Tutorials
HTML Forms
HTML Basics

HTML Basics

Table Styles

Tables can have borders around the cells. The attributes for borders are BORDER, BORDERCOLOR, BORDERCOLORDARK, and BORDERCOLORLIGHT. BORDER sets the size of the border in pixels. BORDERCOLOR, BORDERCOLORDARK, and BORDERCOLORLIGHT are all used to set the color of the border. Using BORDERCOLORDARK and BORDERCOLORLIGHT can create a sense of depth or shadow.


<TABLE BORDER="2" BORDERCOLOR="#FF0000">
<TR>
<TD>1x1</TD>
<TD>1x2</TD>
</TR>
</TABLE>

1x1 1x2

<TABLE BORDER="2" BORDERCOLORDARK="#FF0000" BORDERCOLORLIGHT="#00FF00" >
<TR>
<TD>1x1</TD>
<TD>1x2</TD>
</TR>
</TABLE>

1x1 1x2

Spacing of information is done with the CELLSPACING and CELLPADDING attributes. CELLSPACING determines how much space there is in between cells while CELLPADDING determines how much spacing between the edge of the cell and the content of the cell.

<TABLE BORDER="2" BORDERCOLOR="#000000" CELLSPACING="15">
<TR>
<TD>1x1</TD>
<TD>1x2</TD>
</TR>
<TR>
<TD>2x1</TD>
<TD>2x2</TD>
</TR>
</TABLE>

1x1 1x2
2x1 2x2


<TABLE BORDER="2" BORDERCOLOR="#000000" CELLPADDING="15">
<TR>
<TD>1x1</TD>
<TD>1x2</TD>
</TR>
<TR>
<TD>2x1</TD>
<TD>2x2</TD>
</TR>
</TABLE>

1x1 1x2
2x1 2x2

When you use tables for layout and formatting pages there are two important tags, ROWSPAN and COLSPAN. These attributes are used in the <TD> tag.

Tables <<  1 2 3 4 5
New Content