Home

HTML - Tables


What is a table

In HTML, tables are described as a set of rows and columns.Each row can contain multiple columns. Along with rows and columns tables can optionally contain header and footers.

Simple Table Code

<table>
 <thead>
 <tr>
  <th>heading col 1</th>
  <th>heading col 2</th>
 </tr>
 </thead>
 <tr>
  <td>row 1, column 1</td>
  <td>row 1, column 2</td>
 </tr>
 <tr>
  <td>row 2, column 1</td>
  <td>row 2, column 2</td>
 </tr>
</table>
heading col 1 heading col 2
row 1, column 1 row 1, column 2
row 2, column 1 row 2, column 2