【发布时间】:2020-03-02 11:30:36
【问题描述】:
我正在使用 bootstrap 4 个表来创建一个可配置的 24 x 7 小时调度程序。我需要通过始终为每个表格单元格提供所需的宽度来水平对齐每个表格单元格中的单选按钮,但我正在努力让它工作。请注意,当表格超出屏幕宽度并需要水平调整器时会出现问题。
突出显示此问题的代码如下:
<div class="row form-group ml-md-2 mr-md-2">
<div class="col-md-12">
<table class="table table-bordered table-responsive table-hover table-striped table-condensed">
<thead>
<tr>
<th></th>
<th>8am</th>
<th>9am</th>
<th>10am</th>
<th>11am</th>
<th>12pm</th>
<th>13pm</th>
<th>14pm</th>
<th>15pm</th>
<th>16pm</th>
<th>17pm</th>
<th>18pm</th>
<th>13pm</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Sun</strong></td>
<td>
<div class="form-group">
<div class="radio">
<label class="control-label font-weight-bold">
<input type="radio" asp-for="@Model.MachineState" value="Manual" />
<span asp-validation-for=@Model.MachineState></span>Manual
</label>
</div>
<div class="radio">
<label class="control-label font-weight-bold">
<input type="radio" asp-for="@Model.MachineState" value="On" />
<span asp-validation-for=@Model.MachineState></span>On
</label>
</div>
<div class="radio">
<label class="control-label font-weight-bold">
<input type="radio" asp-for="@Model.MachineState" value="Off" />
<span asp-validation-for=@Model.MachineState></span>Off
</label>
</div>
</div>
</td>
... @*Repeat this <td></td> for the other day - time cells. *@
</tr>
</tbody>
</table>
</div>
</div>
[![enter image description here][1]][1]
【问题讨论】:
-
能否分享一下问题的截图?
-
以下使用最小宽度样式更新是对此的硬编码解决方案:```
```...
标签: c# html css asp.net-core bootstrap-4