< html‎ | elements
Jump to: navigation, search


This article is Not Ready.

W3C Recommendation


The <table> element is a wrapper for an HTML table. It defines the start and end of a table, and can contain other table elements, such as <tr>.

Overview Table

DOM Interface HTMLTableElement

The <table> element is a container for HTML table data, which is used to mark up tabular data. Tabular data is any data that can be systematically displayed in rows and columns, for example, "See table 3 for an example."

Tables were often used for laying out web pages because tables helped fix the position of text on the page, however, this use has become an outdated. We recommend you use <div> and <span> for fixed layouts. You can still use tables for tabular data.

You might find working with an HTML table editor easier than coding tables by hand, unless you are especially adept at visualizing table row and columns using the appropriate HTML tags. It is easy to miss or drop a tag when coding tables manually, which will cause your table to be malformed.


This example uses the tbody element with the table, td, thead, and tr elements to create a table with the first row in the table head and the second row in the table body.


        This text is in the thead.
        This text is in the tbody.


 At the most simple level you need to use the following three groups of tags to create a basic table. 
tag begins the table, and <ltable> tag ends the table. 2> <tr</tr> creates a row while ends the row. 3> ends the column space. These are usually nested inside a pair of tags. The term "td" stands for table data, but as a representation, you can view it like a "column tag".

The three pairs of tags can create a simple two row, two column table using the code below.

creates a column space while
row 1 col 1row 1 col 2
row 1 col 2row 2 col 2

Related specifications

Specification Status Related Changes
HTML 5.1 W3C Working Draft
HTML 5 W3C Recommendation
HTML 4.01 W3C Recommendation

See also

Related articles