George and Susan Welcome to our HTML help page!
Home | HTML-Index | Basic HTML | HTML Structure

Create Row Groups


Use the <THEAD>, <TBODY> and <TFOOT> tags to create row groups in a table. Row groups divide a table into horizontal sections, allowing you to quickly format multiple rows of cells at the same time.

The <THEAD> tag allows you to create a header row group in your table. This is useful for headings that you want to format differently then the main data in your table. The <THEAD> tag can only appear once in a table.

Use the <TBODY> tag to create one or more body row groups in your table. Body row groups usually contain the rows of data in your table.

The <TFOOT> tag allows you to create a footer row group in a table. This is useful for summary data or totals that appear at the bottom of your table. The <TFOOT> tag can only appear once in a table.

You do not need to include all three types or row groups in a table. For example, you may only want to create a body row group.

Type this:
down
<TABLE BORDER=1 WIDTH="75%" ALIGN=CENTER>
<colgroup width="20%" align="center" valign="top">
<colgroup span="2" width="40%" valign="top">
<TR BGCOLOR="#CC9933">
<TH>George's Products</TH>
<TH>Price per unit</TH>
<TH>Number of units</TH>
</TR>
<TBODY BGCOLOR="#FFCC00">
<TR>
<TD>Art Print</TD>
<TD>$9.99</TD>
<TD>40</TD>
</TR>
<TR>
<TD>Books</TD>
<TD>$3.99</TD>
<TD>75</TD>
</TR>
</TBODY>
<TFOOT BGCOLOR="#CCCC33">
<TR>
<TD COLSPAN="3" ALIGN=CENTER>Are we having fun yet?</TD>
</TR>
</TFOOT>
</TABLE>


And you get the following:
down
George's Products Price per unit Number of units
Art Print $9.99 40
Books $3.99 75
Are we having fun yet?


My home page
Back to Top