CSS Portal

HTML <table> Tag

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The <table> HTML element is used to create a structured grid of data composed of rows and columns. It provides a way to display information in a tabular format, making it easier to read, compare, and organize data on a webpage. Tables are widely used for displaying datasets, schedules, statistics, or any information that benefits from a clear row-and-column layout.

A basic <table> consists of one or more <tr> (table row) elements, which themselves contain <td> (table data) cells for content or <th> (table header) cells for headers. Headers are typically bold and centered by default, providing context for the data in their corresponding rows or columns.

Tables can be simple, with just rows and cells, or more complex, with additional elements like <caption> for a title or description, <thead> for grouping header rows, <tbody> for the main body of data, and <tfoot> for footer rows. These elements improve semantic structure, accessibility, and styling flexibility.

Although <table> is a powerful tool for displaying structured information, modern web design practices recommend using tables only for tabular data, rather than for page layout, as layout tables can hinder accessibility and responsiveness.

Properties

Permitted Parents
Any element that accepts flow content
Content
An optional <caption>, zero or more <col> or <colgroup> tags, optional <thead> and <tfoot>, zero or more <tbody> tags and at least one <tr>
Start/End Tags
Start tag: required, End tag: required

Example

<table border="1">
<tr>
<td>Cat</td>
<td>Dog</td>
</tr>
<tr>
<td>Mouse</td>
<td>Bird</td>
</tr>
</table>

Attributes

None

Global Attributes

The <table> tag also supports the Global Attributes in HTML5

Event Attributes

The <table> tag also supports the Event Attributes in HTML5

Browser Support

The following information will show you the current browser support for the HTML <table> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.

This tag is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 26th December 2025

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!