1. Home
  2. Computing & Technology
  3. Web Design / HTML

<table></table>

By Jennifer Kyrnin, About.com

<table> description:

The <table> element creates tables inside Web documents.

<table> Web Browser Support:
<table> Attributes:
<table> End Tag:
</table> REQUIRED
Contents:

table content. The following tags are valid within the <table> tag:
caption, col, colgroup, tbody, tfoot, thead

<table> Valid Context:

The <table> tag is valid within the following tags:
blockquote, body, button, center, dd, div, fieldset, form, iframe, li, noframes, noscript, object, td, th

<table> Usage:
  • basic table
    <table border width="200">
    <tr><td>
    column 1
    </td><td>
    column 2
    </td></tr>
    </table>
  • complex table
    <table cellspacing="2" cellpadding="2" frame="below" rules="groups" summary="This complex table contains three columns of data and two rows, and is meant to demonstrate table effects">
    <caption>This is a more complex table</caption>
    <colgroup span="2" />
    <colgroup span="1" id="group2" />
    <tr>
    <th>row 1 column 1 group 1</th>
    <th>row 1 column 2 group 1</th>
    <td>row 1 column 3 group 2</td>
    </tr>
    <tr>
    <td>row 2 column 1 group 1</td>
    <td>row 2 column 2 group 1</td>
    <td>row 2 column 3 group 2</td>
    </tr>
    </table>

<table> Special Notes

  • In XHTML, tables are meant to display only tabular data. If you want to layout your Web page, you should use style sheets.
  • Keep in mind that tables are not very accessible. Use features like caption and summary to make it more accessible.

More <table> Information

Return to XHTML element (HTML Tags) Library

More about the Tag
Related HTML Tags
  • Jennifer Kyrnin
    Guide since 1997

    Jennifer Kyrnin
    Web Design / HTML Guide

    About.com Special Features

    Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

    Easy ways to connect two computers for networking purposes. More >