Tables

suggest change

Introduction

The HTML <table> element allows web authors to display tabular data (such as text, images, links, other tables, etc.) in a two-dimensional table with rows and columns of cells.

Syntax

Remarks

The various table elements and their content attributes together define the table model. The <table> element is the container element for table models/tabular data. Tables have rows, columns, and cells given by their descendants. The rows and columns form a grid; a table’s cells must completely cover that grid without overlap. The list below describes the various elements in the table model:

Semantically, tables are meant for holding tabular data. You can think of it as a way to display and describe data that would make sense in a spreadsheet (columns and rows).

Using tables for layout is not recommended. Instead, use CSS rules for layout and formatting, including display: table.

One notable exception is HTML email: some email clients, including Outlook (which renders HTML with Microsoft Word’s engine), have poor support for modern CSS, so table-based layouts are still commonly used for cross-client compatibility.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents