在Bootstrap中,可以使用rowspan属性来合并单元格。

例如,如果要将一个单元格合并到下一个单元格中,可以这样写:

<table class="table">
  <thead>
    <tr>
      <th>#</th>
      <th>First Name</th>
      <th>Last Name</th>
      <th>Username</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td rowspan="2">1</td>
      <td>John</td>
      <td>Doe</td>
      <td>@johndoe</td>
    </tr>
    <tr>
      <td>Jane</td>
      <td>Smith</td>
      <td>@janesmith</td>
    </tr>
    <tr>
      <td>2</td>
      <td>Mark</td>
      <td>Johnson</td>
      <td>@markjohnson</td>
    </tr>
  </tbody>
</table>

在上面的示例中,第一列的两个单元格被合并成了一个单元格,并且跨越了两行

bootstrap合并单元格

原文地址: https://www.cveoy.top/t/topic/iwi2 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录