Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第 112 期(W3C 标准-HTML):table的colgroup和col #115

Open
wingmeng opened this issue Sep 19, 2019 · 0 comments
Open

第 112 期(W3C 标准-HTML):table的colgroup和col #115

wingmeng opened this issue Sep 19, 2019 · 0 comments

Comments

@wingmeng
Copy link
Collaborator

<colgroup> 标签用来定义表格列的分组,<col> 的作用是细化 <colgroup> 分组,因为即使在一个组中,列与列之间也可能会出现一些差别。例如一个表格前三列要垂直靠上,后两列垂直靠下。
<colgroup><col> 这两个标签在 Chrome、FireFox、Safari 等浏览器中只支持背景色、span、宽度等少数几种样式属性,只有在IE浏览器才能获得完全支持。

> 在线示例 <

image

<table class="ui-table">
  <colgroup style="width:100px; background:#eee;">
    <col style="background:#c00">
    <col style="background:#090">
    <col style="width:60px; background:#069">
  </colgroup>
  <colgroup span="2" style="background:#fc0"></colgroup>
  <thead>
    <tr>
      <th>第1列</th>
      <th>第2列</th>
      <th>第3列</th>
      <th>第4列</th>
      <th>第5列</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>第1列</td>
      <td>第2列</td>
      <td>第3列</td>
      <td>第4列</td>
      <td>第5列</td>
    </tr>
    <tr>
      <td>第1列</td>
      <td>第2列</td>
      <td>第3列</td>
      <td>第4列</td>
      <td>第5列</td>
    </tr>
    <!-- 略 -->
  </tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant