答案 0 :(得分:1)
由于表格元素按其内容增长,你需要给它们一个宽度,所以如果你像这样更新你的CSS它会起作用
table {
width: 100%;
border-collapse: collapse;
}
td {
width: 25%;
}
td select {
width: 100%;
}
示例代码段
table th, table td {
border:1px solid grey;
}
table {
width: 100%;
border-collapse: collapse;
}
td {
width: 25%;
}
td select {
width: 100%;
}

<table>
<thead>
<tr>
<th>Group Name</th>
<th style='width:50px'>Members</th>
<th>Genre</th>
<th>From</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<select>
<option>Red Hot Chili Peppers</option>
<option>Depeche Mode</option>
<option>very-very-very long text, it will be crush the table</option>
</select>
</td>
<td>
<select>
<option>4</option>
<option>3</option>
<option>very-very-very long text, it will be crush the table</option>
</select>
</td>
<td>
<select>
<option>funk-rock/rock/alternative</option>
<option>Synthpop/new-wave</option>
<option>very-very-very long text, it will be crush the table</option>
</select>
</td>
<td>
<select>
<option>USA</option>
<option>UK</option>
<option>very-very-very long text, it will be crush the table</option>
</select>
</td>
</tr>
</tbody>
</table>
&#13;
答案 1 :(得分:0)
将宽度应用于选择元素:
<select style="width:50px;"></select>