Home >Web Front-end >Front-end Q&A >How to use html table tag

How to use html table tag

青灯夜游
青灯夜游Original
2019-05-27 15:05:254398browse

html table tag is used to define HTML tables. A simple HTML table consists of the table element and one or more tr, th or td elements. The tr element defines table rows, the th element defines table headers, and the td element defines table cells.

How to use html table tag

#html How to use table tag?

table tag defines HTML table.

Description:

A simple HTML table consists of the table element and one or more tr, th or td elements. The tr element defines table rows, the th element defines table headers, and the td element defines table cells. More complex HTML tables may also include caption, col, colgroup, thead, tfoot, and tbody elements.

Note:

All major browsers support the

tag. In HTML 4.01, the "align" and "bgcolor" attributes of the table element are deprecated. In the XHTML 1.0 Strict DTD, the "align" and "bgcolor" attributes of the table element are not supported.

html table tag Example:

<!DOCTYPE html>
<html>
<body>
<table border="1">
  <tr>
    <th>name</th>
    <th>job</th>
  </tr>
  <tr>
    <td>灭绝师太</td>
    <td>PHP中文网高级讲师</td>
  </tr>
    <tr>
    <td>欧阳克</td>
    <td>PHP中文网讲师</td>
  </tr>
    <tr>
    <td>韦小宝</td>
    <td>PHP中文网初级讲师</td>
  </tr>
</table>
</body>
</html>

Rendering:

How to use html table tag

The above is the detailed content of How to use html table tag. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to use html sup tagNext article:How to use html sup tag