html - 如何固定同一个表中的特定列宽

标签 html css tablecolumn

<table class="striped">
    <tr><td width="25%">ASD</td></tr>
    <tr><td width="50%">ASD</td></tr>
</table>

通过添加边框,它清楚地表明两行将具有完全相同的宽度,即 50%。自定义第二行宽度修复的最简单方法是什么?

最佳答案

您需要为第一行添加一个空列。检查一下:

<table class="striped">
    <tr><td>ASD</td><td class="abc"></td><</tr>
    <tr><td colspan="2">ASDsdfsdfsdf</td></tr>
</table>

CSS:

table.striped td{
    border:1px solid #000;
    width:25%;
}
.abc {
    border:0 !important;
}

Example

关于html - 如何固定同一个表中的特定列宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28955916/

相关文章:

html - 滚动 float

css - CSS 粘性页脚的水平溢出问题

java - 如何从表列javafx中删除行

html - 内联 <P 样式>

php - Contenteditable 与输入替换

javascript - 如何用图像替换单选按钮

html - 水平图像的响应图像叠加

javascript - 在一个 div 中放大和缩小

java - 使用 JavaFX 自动调整 TableView 中 TableColumn 的 TableColumn 大小 -8

java - 从数据库表中选择列并在java中重命名它们