HTML Tutorials
HTML Forms
HTML Basics

HTML Basics

Tables

Tables are used to organize pages. For example the menu bar going down the left side is a series of images arranged in a table. Tables use the <TABLE> tag to start and do need to be closed. Tables are organized into rows and then cells of data within the row. Rows are started and ended with the <TR> and </TR> tags respectively.

Example:
<TABLE BORDER="1">
<TR>
<TD>1x1</TD>
<TD>1x2</TD>
<TD>1x3</TD>
</TR>
<TR>
<TD>2x1</TD>
<TD>2x2</TD>
<TD>2x3</TD>
</TR>
<TR>
<TD>3x1</TD>
<TD>3x2</TD>
<TD>3x3</TD>
</TR>
<TABLE>


1x1 1x2 1x3
2x1 2x2 2x3
3x1 3x2 3x3

The TABLE tag has visual components to enhance the display of information. Formatting components such as WIDTH and HEIGHT can be set as pixels or percentages. The BGCOLOR attribute sets the background color of the table row or cell of data based on the tag used. BGCOLOR uses hex codes for RGB to determine color. For example #000000 is black and #FFFFFF is white. These three components can all be set in the <TABLE> <TR> or <TD> tags.

Example:

<TABLE WIDTH="100%">
<TR WIDTH="100%">
<TD BGCOLOR="#FF0000" WIDTH="20%">20%</TD>
<TD BGCOLOR="#00FF00" WIDTH="20%">20%</TD>
<TD BGCOLOR="#0000FF" WIDTH="20%">20%</TD>
<TD BGCOLOR="#FFFF00" WIDTH="20%">20%</TD>
<TD BGCOLOR="#FF00FF" WIDTH="20%">20%</TD>
</TR>
</TABLE>

20% 20% 20% 20% 20%
Images <<  1 2 3 4 5  >> Table Styles
New Content