HTML <table> Tag

If this site has been useful, we’d love your support! Running this site takes time and resources, and every small contribution helps us keep creating valuable content. Consider buying us a coffee to keep things going strong!

Description

The <table> HTML element serves as a container for elements that define the contents of the table. Any table consists of rows and cells, which are specified using the <tr> and <td> elements. The following elements are allowed inside the <table> : <caption>, <col>, <colgroup>, <tbody>, <td>, <tfoot>, <th>, <thead> and <tr>.

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 table will show you the current browser support for the HTML <table> tag.

Desktop
Edge Chrome Firefox Opera Safari
121112.11
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
18412.1114.4

Last updated by CSSPortal on: 30th March 2024