The best HTML <table> tag Tutorial In 2024, In this tutorial you can learn Examples,Browser Support,Tag definitions and instructions,Differences between HTML 4.01 and HTML5,Attributes,Global Properties,Event Properties,Try - Example,related articles,
A simple HTML table, containing two two lines:
All major browsers support the <table> tag.
<Table> tag defines an HTML table
The table includes a HTML <table> element, one or more <TR> , <TH> and <td> elements.
<Tr> element defines a table row, <th> element defines the table header, <td> element defines a table cell.
More complex forms may also include HTML <caption>, <col>, <colgroup>, <thead>, <tfoot> and <tbody> element.
In HTML5 support only "border" property, and only allow the use of the value "1" or "."
属性 | 值 | 描述 |
---|---|---|
align | left center right |
HTML5 不支持。HTML 4.01 已废弃。 规定表格相对周围元素的对齐方式。 |
bgcolor | rgb(x,x,x) #xxxxxx colorname |
HTML5 不支持。HTML 4.01 已废弃。 规定表格的背景颜色。 |
border | 1 "" |
规定表格单元是否拥有边框。 |
cellpadding | pixels | HTML5 不支持。规定单元边沿与其内容之间的空白。 |
cellspacing | pixels | HTML5 不支持。规定单元格之间的空白。 |
frame | void above below hsides lhs rhs vsides box border |
HTML5 不支持。规定外侧边框的哪个部分是可见的。 |
rules | none groups rows cols all |
HTML5 不支持。规定内侧边框的哪个部分是可见的。 |
summary | text | HTML5 不支持。规定表格的摘要。 |
width | pixels % |
HTML5 不支持。规定表格的宽度。 |
<table> tag supports HTML global properties .
<table> tag supports HTML event properties .
Table title
This example demonstrates how to display table headers.
Empty Cells
This example demonstrates how to use the "& nbsp;" no content processing cell.
Table with headings
This example demonstrates with a title (caption) form.
Tags within the table
This example demonstrates how to display elements inside other elements.
Interbank across columns or table cell
This example demonstrates how to define cross or across columns of a table cell.
HTML Tutorial: HTML table
HTML DOM Reference Manual: the Table Object