我有以下代码:
.table {
display: table;
}
.row {
display: table-row;
}
.cell {
display: table-cell;
}
.colspan2 {
/* What to do here? */
}
<div class="table">
<div class="row">
<div class="cell">Cell</div>
<div class="cell">Cell</div>
</div>
<div class="row">
<div class="cell colspan2">Cell</div>
</div>
</div>
很简单。我如何为具有 display: table-cell
属性的元素添加 colspan(或等价的colspan)?
display: table-cell
。 - thirtydot