0
我一直試圖讓移動上的列寬變爲50%,但是我嘗試過的所有內容都沒有奏效。這是CSS。調整表格中的列寬(CSS/HTML)
@media (max-width: 768px) {
#customTable tbody { float: left; }
#customTable thead { float: left; }
#customTable thead { min-width: 120px }
#customTable td { display: block }
#customTable th { display: block }
#customTable {table-layout: fixed;}
#customTable td {width: 50%;}
#customTable td {height: 20px; overflow: hidden;}
#customTable div {height: 20px;overflow: hidden;}
}
下面是HTML
<div class="table">
<table id="customTable" class="table" style="width: 100%">
<thead>
<tr>
<th><LABEL>Test 1</LABEL></td>
<th><LABEL>Test 2</LABEL></td>
<th><LABEL>Test 3</LABEL></td>
<th><LABEL>Test 4</LABEL></td>
</tr>
</thead>
<tr>
<td><LABEL>Test</LABEL></td>
<td><LABEL>Test</LABEL></td>
<td><LABEL>Test</LABEL></td>
<td><LABEL>Test</LABEL></td>
</tr>
</table>
</div>
您如何期望4列各佔50%?這不是200%? –