Heim  >  Artikel  >  Web-Frontend  >  Was bedeutet col in HTML?

Was bedeutet col in HTML?

WBOY
WBOYOriginal
2022-09-02 15:59:245939Durchsuche

col在html中是“列”的意思;col是html中的标签,是“column”的缩写,该标签是给表格中一个或者多个列应用样式,而不需要重复为每个单元格或每一行设置样式,标签规定了元素内部每一列的属性,只能在table或colgroup元素中使用该标签。

Was bedeutet col in HTML?

本教程操作环境:windows10系统、HTML5版本、Dell G3电脑。

col在html中是什么意思

标签的定义标签的“col”是“column”英文单词的缩写,中文有“列”的意思;标签是给表格中一个或多个列应用样式,而不需要重复为每个单元格或每一行设置样式;标签规定了  元素内部的每一列的列属性;标签设置的样式会被标签设置的样式覆盖;

HTML

标签规定了 元素内部的每一列的列属性。

通过使用

标签,可以向整个列应用样式,而不需要重复为每个单元格或每一行设置样式。

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

如需对全部列应用样式,

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

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

标签。

示例如下:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>123</title> 
</head>
<body>
<table border="1">
  <colgroup>
    <col span="2" style="background-color:red">
    <col style="background-color:yellow">
  </colgroup>
  <tr>
    <th>ISBN</th>
    <th>Title</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>3476896</td>
    <td>My first HTML</td>
    <td>$53</td>
  </tr>
  <tr>
    <td>5869207</td>
    <td>My first CSS</td>
    <td>$49</td>
  </tr>
</table>
</body>
</html>

输出结果:

Was bedeutet col in HTML?

(学习视频分享:css视频教程html视频教程

Das obige ist der detaillierte Inhalt vonWas bedeutet col in HTML?. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn