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

How to use html col tag

藏色散人
Release: 2019-05-26 14:02:52
Original
3769 people have browsed it

html The col tag is used to define attribute values ​​for one or more columns in a table. If you need to apply styles to all columns, the

tag is useful, so that you do not need to repeatedly apply styles to each unit and row. You can only use the tag within a table or colgroup element.

How to use html col tag

#html How to use col tag?

Function: One or more columns in the table define attribute values.

Note:

The

tag is useful if you need to apply styles to all columns, so that you don't need to apply styles repeatedly to each cell and row. You can only use the tag within a table or colgroup element.

Note: In HTML,

has no closing tag. In XHTML, the tag must be closed properly.

html col tag usage example

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table width="100%" border="1">
    <col />
    <col />
    <col />
    <tr>
        <th>商品种类</th>
        <th>名称</th>
        <th>价格</th>
    </tr>
    <tr>
        <td>衣服</td>
        <td>衬衣</td>
        <td>53元</td>
    </tr>
    <tr>
        <td>鞋子</td>
        <td>板鞋</td>
        <td>199元</td>
    </tr>
</table>
</body>
</html>
Copy after login

Effect:

How to use html col tag

The above is the detailed content of How to use html col tag. 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