ROWS and COLUMNS

As mentioned previously, tables are a series of rows divided up into columns. A table with only one cell has one row and one column. The <TR> </TR> tags designate a table row. After starting the table with the opening <TABLE> tag, the next tag has to be the first row <TR>. Because a row or a column can use some of the same attributes, we will cover them together.

Once you have started a row, the next thing is to determine how many columns, or cells, that row will contain. A cell is defined by a table data tag <TD> </TD>. The fourth type of table tag is the table header <TH></TH>. The table header works the same as a table data tag, it just presents the text in a boldface. The text or contents of your table go between the table data <TD> </TD> and table header <TH> </TH> tags.

When you are designing your first tables, it may help to draw them out on paper first.

Examples

HTML How it appears
A single cell table:
<TABLE border=1 bgcolor="#FFFFDA">
<TR><TD>This is the cell</TD></TR>
</TABLE>
This is the cell
A table with two rows and one column:
<TABLE border=1 bgcolor="#FFFFDA">
<TR><TD>Row number 1</TD></TR>
<TR><TD>Row number 2</TD></TR>
</TABLE>
Row number 1
Row number 2
A table with two rows, two columns with headers:
<TABLE border=1 bgcolor="#FFFFDA">
<TR><TH> Column 1 </TH>
<TH> Column 2 </TH></TR>
<TR><TD> Data 1 </TD>
<TD> Data 2 </TD></TR>
<TR><TD>Row number 2</TD></TR>
</TABLE>
Note where the rows start and stop.
Column 1 Column 2
Data 1 Data 2
Table of Contents