javascript - 单选按钮不适合放在表格内?

标签 javascript html jquery css radio-button

我正在开发这个计算器,当用户选择其中一种类型时,应该会出现一个小表格,以从该表格中选择一种类型,但应单击的单选按钮不适合表格

example

这是在表的 ccs 代码中查找,完整代码在 jsfiddle link

    table {
border: 1px solid #ccc;
border-collapse: collapse;
margin: 0;
padding: 0;
width: 100%;
table-layout: fixed;
}
.rad
{width:1em;
height:1em;}
table thead,
table tbody {
  display: block;
}
table thead th ,table tbody td
{
  font-size : 12px;
}
table tbody {
  max-height: 100px;
  overflow-y: overlay;
  overflow-x: hidden;
}
tr:hover{
background-color:gray;
cursor:pointer;
}
table tbody td, table thead th {
  text-align: center;

}

table tbody td:last-child, table thead th:last-child {
  border-right: none;
}

table tbody td:first-child, table thead th:first-child {
  width: 10px;
}
table tbody td:nth-child(2), table thead th:nth-child(2) {
  width: 100px;
}
table tbody td:nth-child(3), table thead th:nth-child(3) {
  width: 100px;
}
table tbody td:nth-child(4), table thead th:nth-child(4) {
  width: 100px;
}
table tbody td:nth-child(5), table thead th:nth-child(5) {
  width: 100px;
}

最佳答案

只需从 input[type="radio"] 的 css 中删除 position:absolute 即可。工作Fiddle .

关于javascript - 单选按钮不适合放在表格内?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62108733/

相关文章:

jquery - 动态添加多个选定值并计算总计

javascript - 如何使用 Dojo 重现此 JQuery ajax

javascript - 动态添加的选择列表未按预期工作

javascript - 设置 ngModel 默认值 Angular 2

javascript - 旋转图像 2 次

javascript - 如何在一个表单、一个按钮中执行 2 个操作?

html - 装载机时序问题

JavaScript 函数调用将 x && y 作为参数传递

javascript - jquery ajax方法未在远程服务器上触发

javascript - React-native 中如何与大小相同的组件共享空间