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

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. XHTML
  6. HTML Tags
  7. The table Element - creates tables - XHTML 1.0 HTML 4.0

©2008 About.com, a part of The New York Times Company.

All rights reserved.