【发布时间】:2020-11-01 07:14:26
【问题描述】:
我还不能解决一个关于引导程序的问题,但我希望有人能给我一些建议来解决它:)
我有一个表格,其中显示了用户可以选择的不同选项。我使用单选按钮来显示不同的选项,因为我只想选择其中一个选项。
我在使用单选按钮时遇到的问题是我不想显示圆圈。
这就是我所拥有的
这就是我想要的 what I want
我试图放置一个包含一行按钮的 div 来应用class="btn-group btn-group-toggle" data-toggle="buttons",但我没有让它工作。如果我在<tr> 标记中编写该代码,它可以工作,但上面的行会移到屏幕右侧。
另外,我尝试使用 css 隐藏圆圈
input[type=radio]{
visibility: hidden;
}
但按钮内的文字没有居中
非常感谢您的宝贵时间和帮助!
这是我的代码:
<table class="table table-responsive">
<thead class="thead-light">
<tr>
<th scope="col">Zona Sísmica</th>
<th scope="col">I</th>
<th scope="col">II</th>
<th scope="col">III</th>
<th scope="col">IV</th>
<th scope="col">V</th>
<th scope="col">VI</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Valor factor Z</th>
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<td>
<label class="btn btn-outline-primary">
<input type="radio" name="z" id="Zop1" value="0.15"> 0.15
</label>
</td>
<td>
<label class="btn btn-outline-primary">
<input type="radio" name="z" id="Zop2" value="0.25"> 0.25
</label>
</td>
<td>
<label class="btn btn-outline-primary">
<input type="radio" name="z" id="Zop3" value="0.30"> 0.30
</label>
</td>
<td>
<label class="btn btn-outline-primary">
<input type="radio" name="z" id="Zop4" value="0.35"> 0.35
</label>
</td>
<td>
<label class="btn btn-outline-primary">
<input type="radio" name="z" id="Zop5" value="0.40"> 0.40
</label>
</td>
<td>
<label class="btn btn-outline-primary">
<input type="radio" name="z" id="Zop6" value="0.50"> ≥0.50
</label>
</td>
</div>
</tr>
</tbody>
</table>
【问题讨论】:
标签: javascript html css twitter-bootstrap radio