我有以下表格,它不是使用标准<table>
标签而是使用 CSS table( display:table, display:table-row, display: table-cell
) 制作的。直到这里没有问题发生,但是我需要一些我无法应用的 CSS 跨度。我用过column-span
但是没用!
HTML:
<div id="form">
<br/><br/>
<form id="form_container">
<span class="row">
<span class="cell"><select></select></span>
<span class="cell"><input type="text" /></span>
</span>
<span class="row">
<span class="cell"><input type="email" /></span>
</span>
<span class="row">
<span class="cell"><select></select></span>
</span>
<span class="row">
<span class="cell"><select></select></span>
</span>
<span class="row">
<span class="cell"><select></select></span>
</span>
<span class="row">
<span class="cell"><input type="text" /></span>
<span class="cell"><select></select></span>
</span>
<span class="row">
<span class="cell"><input type="checkbox" /><b>I have read the</b> <a>Terms & Conditions</a></span>
</span>
<input type="image" src="img/send_button.png" />
</form>
</div>
CSS:
#form_container {
display: table;
}
.row {
display: table-row;
}
.cell {
display: table-cell;
}
input, select {
padding: 5px;
border-radius: 5px;
}
我想要只有一个单元格的行上的 colspan。这对 CSS 是否可行?