HTML Tables


HTML Tables allow you to arrange data into rows and columns.


Define an HTML Table

The <table> tag defines an HTML table.

Each table row is defined with a <tr> tag. Each table header is defined with a <th> tag. Each table data/cell is defined with a <td> tag.

By default, the text in <th> elements are bold and centered.

By default, the text in <td> elements are regular and left-aligned.

A simple HTML table is shown below:


HTML Table - Cell that Spans Many Columns

To make a cell span more than one column, use the colspan attribute:


HTML Table - Cell that Spans Many Rows

To make a cell span more than one row, use the rowspan attribute: