Detailed explanation of the use of tag in html

黄舟
Release: 2017-06-20 15:53:15
Original
4578 people have browsed it

html5中标签作用是定义表格中一个或多个列属性值,这里详细介绍下标签用法、标签属性以及标签应用实例。

html中标签作用:定义表格中一个或多个列属性值

标签用法:

标签为表格中一个或多个列定义属性值。

如需对全部列应用样式, 标签很有用,这样就不需要对各个单元和各行重复应用样式了。

您只能在 table 或 colgroup 元素中使用 标签。

标签应用实例:

col 元素为表格中的三个列规定了不同的对齐方式:

<table width="100%" border="1">  <col align="left" />
  <col align="left" />
  <col align="right" />
  <tr>
    <th>ISBN</th>
    <th>Title</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>3476896</td>
    <td>My first HTML</td>
    <td>$53</td>
  </tr>
</table>
Copy after login

标签有哪些属性?

哪些浏览器支持标签?

所有主流浏览器都支持标签。

html中col标签的实例

<html>
<body>
<table border="2">
<col span="2" style="color:red">
<col style="color:blue">
<tr>
<td>红色</td>
<td>红色</td>
<td>蓝色</td>
</tr>
<tr>
<td>红色</td>
<td>红色</td>
<td>蓝色</td>
</tr>
</table>
</body>
</html>
Copy after login

这样就可以给每一列设置样式,而不用在每个td里面设置。

第一二两列是红的。第三列是蓝的。

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!