gpt4 book ai didi

javascript - 使用现有类将表 6 行转换为 2 行 3 列

转载 作者:行者123 更新时间:2023-11-28 10:13:48 31 4
gpt4 key购买 nike

有没有办法使用现有的类将现有的 6 行表转换为 2 行 3 列。我无权访问 html 文件。只能向现有类添加样式表

<table cellspacing="0">
<tbody><tr>
<td class="class1"><label for="radio0">
<input type="radio" checked="" value="1" name="name" id="radio0">1
</label></td>
</tr>
<tr>
<td class="class2"><label for="radio1">
<input type="radio" value="8" name="name" id="radio1">2
</label></td>
</tr>
<tr>
<td class="class3"><label for="radio2">
<input type="radio" value="12" name="name" id="radio2">3
</label></td>
</tr>
<tr>
<td class="class4"><label for="radio3">
<input type="radio" value="4" name="name" id="radio3">4
</label></td>
</tr>
<tr>
<td class="class5"><label for="radio4">
<input type="radio" value="7" name="name" id="radio4">5
</label></td>
</tr>
<tr>
<td class="class6"><label for="radio5">
<input type="radio" value="5" name="name" id="radio5">6
</label></td>
</tr>

</tbody></table>

最佳答案

您总是可以将元素定位为绝对的,但我想警告您它可能不会保持一致。这也只是改变了 CSS。例子是 here

CSS:

.class3{
position:absolute;
margin-left: 40px;
top: 9px;
}
.class4{
position:absolute;
margin-left: 40px;
top: 30px;
}
.class5{
position:absolute;
margin-left: 80px;
top: 9px;
}
.class6{
position:absolute;
margin-left: 80px;
top: 30px;
}

关于javascript - 使用现有类将表 6 行转换为 2 行 3 列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24290445/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com