HTML Element Reference

Table Elements

Tag

Name

Description

<caption> Caption Defines a table caption. The caption element must be defined directly after the <table> element. By default the caption is center aligned above the table
<table> Table Wrapper for all table elements
<thead> Table Head Wrapper for heading elements. Specifies the heading part of the table
<th> Table Header Defines a header cell. Text in header cells are bold and centered by default
<tbody> Table Body Wrapper for the body table elements. Specifies the main portion of the table
<tr> Table Row Wrapper for a single row of table data
<td> Table Data Defines a data cell. Text in data cells are left-aligned by default
<tfoot> Table Foot Wrapper for table footer elements. Specifies the end of the table

<thead>, <tbody>, and <tfoot> can be used in conjunction to allow scrolling of the body independant of the header and footer. When a table spans multiple pages, they also allow for the header and footer to be printed at the top and bottom of each page.

Table Attributes

Attribute

Name

Description

colspan Column Span Defines how many columns a <td> element should span
rowspan Row Span Defines how many rows a <td> element should span