In
html, the tag of the table is "
", which is used to define HTML tables; but the elements in the table need to be defined using one or more tr, th, td and other tags, the syntax is "< ;table> |
|
".
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer. The
tag defines an HTML table. A simple HTML table consists of the table element and one or more tr, th or td elements.
The tr element defines the table row, the th element defines the header, and the td element defines the table cell.
More complex HTML tables may also include caption, col, colgroup, thead, tfoot, and tbody elements.
Example:
<table border="1">
<tr>
<th>商品</th>
<th>价格</th>
</tr>
<tr>
<td>T恤</td>
<td>¥100</td>
</tr>
<tr>
<td>牛仔褂</td>
<td>¥250</td>
</tr>
<tr>
<td>牛仔库</td>
<td>¥150</td>
</tr>
</table>
Copy after login
Rendering:
#
Optional attributes of label
Attributes | Value | Description |
align |
|
Deprecated. Please use styles instead. Specifies the alignment of the table relative to surrounding elements.
|
bgcolor |
##rgb(x,x,x) #xxxxxx colorname
|
Deprecated. Please use styles instead. Specifies the background color of the table.
|
border
| pixels
Specifies the width of the table border. |
|
cellpadding
|
Specifies the space between the edge of the cell and its content. |
|
cellspacing
|
Specifies the space between cells. |
|
frame
|
void
- above
- below
- hsides
- lhs
- rhs
- vsides
- box
- border
-
Specifies which part of the outer border is visible. |
|
rules
|
noneSpecifies which part of the inner border is visible. |
|
summary
| text
Specifies the summary of the table. |
|
width
|
##%
-
pixels
Specifies the width of the table.
|
|
Recommended tutorial: "html video tutorial
"
The above is the detailed content of What are the tags of html tables. For more information, please follow other related articles on the PHP Chinese website!