HTML 5 <table> Tag
Example
A simple HTML table, containing two columns and two rows:
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table> |
View it » |
Definition and Usage
The <table> tag defines an HTML table.
A simple HTML table consists of the table element and one or more tr, th, and td
elements.
The tr element defines a table row, the th element defines a table header, and
the td element defines a table cell.
A more complex HTML table may also include caption, col, colgroup, thead, tfoot,
and tbody elements.
Differences Between HTML 4.01 and HTML 5
Only the "summary" attribute is supported in HTML 5.
Tips and Notes
Note: You should try not to use the "summary" attribute. If the
information in the "summary" attribute is important, you should use a table
caption.
Attributes
Attribute |
Value |
Description |
border |
pixels |
Not supported in HTML 5 |
cellpadding |
pixels |
Not supported in HTML 5 |
cellspacing |
pixels |
Not supported in HTML 5 |
frame |
void
above
below
hsides
lhs
rhs
vsides
box
border |
Not supported in HTML 5 |
rules |
none
groups
rows
cols
all |
Not supported in HTML 5 |
summary |
text |
Specifies a summary of the content of a table |
width |
pixels
% |
Not supported in HTML 5 |
Standard Attributes
The <a> tag also supports the Standard Attributes in HTML 5.
Event Attributes
The <a> tag also supports the Event Attributes
in HTML 5.
|