我的單選按鈕對齊有問題。我想自由設置單選按鈕的位置,但是現在我無法正確設置代碼。設置表格單元格中單選按鈕的位置
它停留在頂部的中間,我只能更改margin-left
。 任何人都可以幫助我嗎?
你可以在這裏找到我的代碼:https://jsfiddle.net/3vL8Lgo9/
.divTable {
display: table;
}
.divTableRow {
display: table-row;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
}
.divTableCell,
.divTableHead {
display: table-cell;
padding: 3px 10px;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
font-weight: bold;
}
.divTableFoot {
background-color: #EEE;
display: table-footer-group;
font-weight: bold;
}
.divTableBody {
display: table-row-group;
}
<table class="divTable" border="1" cellspace="0" cellpadding="0" style="width:1134px; height:756px;">
<tbody class="divTableBody">
<tr class="divTableRow">
<td class="divTableCell" style="width:900px; height:194px;" colspan="4"></td>
<td class="divTableCell" style="width:234px; height:194px;"></td>
</tr>
<tr class="divTableRow">
<td colspan="5" style="width:1134px; height:185px;"></td>
</tr>
<tr class="divTableRow" style="padding-top:100px;">
<td class="divTableCell" rowspan="2" style="width:140px; height:293px;"></td>
<td class="divTableCellRadioButton" style="width:35px; height:146px;">
<input type="radio" name="gender" value="male">
</td>
<td class="divTableCell" rowspan="2" style="width:251px; height:293px;"></td>
<td class="divTableCellRadioButton" style="width:35px; height:146px;"></td>
<td class="divTableCell" rowspan="2" style="width:673px; height:293px;"></td>
</tr>
<tr class="divTableRow">
<td class="divTableCellRadioButton" style="width:35px; height:146px;"></td>
<td class="divTableCellRadioButton" style="width:35px; height:146px;"></td>
</tr>
<tr class="divTableRow">
<td class="divTableCell" style="width:1000px; height:84px;" colspan="4"></td>
<td class="divTableCell" style="width:134px; height:84px;"></td>
</tr>
</tbody>
</table>
使用'垂直對齊:底部;'或'垂直對齊:首位;'的'TD,使其上下移動 –