答案 0 :(得分:1)
使用colgroup
https://jsfiddle.net/j6vdk8c0/
<table>
<colgroup>
<col width="100px">
<col width="200px">
<col width="300px">
<col width="400px">
</colgroup>
<thead>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
</tr>
</thead>
</table>
答案 1 :(得分:1)
您可以使用display:table
代替表格
示例:
.table {
display: table;
border-collapse: collapse;
}
.table .table-row {
display: table-row;
}
.table .table-cell {
display: table-cell;
text-align: left;
vertical-align: top;
border: 1px solid black;
}
&#13;
<div class="table">
<div class="table-row">
<div class="table-cell">test</div>
<div class="table-cell">test1123</div>
</div>
<div class="table-row">
<div class="table-cell">test</div>
<div class="table-cell">test123</div>
</div>
</div>
&#13;
答案 2 :(得分:-1)
@wuxue你可以直接使用内联css style =“width:;”或者在css中创建一个类并应用它。