css - 如何使 td 在没有 colspan 的情况下填充表格中的所有行
问题描述
我有一个问题,这是我的代码:
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th colspan="9" style="text-align: center">Main Header</th>
</tr>
</thead>
<tr>
<th>checkbox</th>
<th>columna 1</th>
<th>columna 2</th>
<th>columna 3</th>
<th>columna 4</th>
<th>columna 5</th>
<th>columna 6</th>
<th>columna 7</th>
<th>columna 8</th>
<th>columna 9</th>
</tr>
<tr>
<td><input type="checkbox" /></td>
<td>coso 1</td>
<td>coso 2</td>
<td>coso 3</td>
<td>coso 4</td>
<td>coso 5</td>
<td>coso 6</td>
<td>coso 7</td>
<td>coso 8</td>
<td>coso 9</td>
</tr>
<tr>
<th></th>
<th>columna 1</th>
<th>columna 2</th>
<th>columna 3</th>
<th>columna 4</th>
</tr>
<tr>
<td><input type="checkbox" /></td>
<td>coso 1</td>
<td>coso 2</td>
<td>coso 3</td>
<td>coso 4</td>
</tr>
</table>
我正在使用 Bootstrap,问题是第四行和第五行比其他行短,我想做的是那些 td 填充所有宽度而没有 colspan,因为行来自服务器,我不知道有多少,我只知道最大的列数是 9,我要做的是填充所有宽度,以便在较短的行的右侧没有空白。
解决方案
推荐阅读
- java - Java中的内部静态与非静态异常类
- java - Hibernate / Spring data JPA 是否支持 Redis Pipelining?
- python - 长时间运行的 Python 程序(使用 Pandas)不断增加内存使用量
- php - 如何模拟翻译服务以对依赖它的表单组件进行单元测试?
- php - 为空描述显示 Woocommerce 产品页面默认描述
- android - 如何使用 Storage Access Framework android 将文件保存到下载文件夹?
- python-3.x - Odoo 12 - 生成和下载 CSV 文件
- bash - 文件不是通过 bash 脚本添加到 zip 中,而是在终端的命令行中工作
- c# - c#如何将标签传递给匿名表单
- javascript - 简单的 addEventlistener 不起作用我不知道如何解决它