gpt4 book ai didi

html - 表格 td 元素在错误的列下换行

转载 作者:太空宇宙 更新时间:2023-11-04 01:07:26 25 4
gpt4 key购买 nike

我有一个表格,当浏览器窗口变窄时,它会折叠在错误的列下,使阅读变得困惑。即来自:

enter image description here到: enter image description here

如何让最后一个文本框换行到正确的列下?我尝试将 border collapse css 设置为“separate”,但没有任何区别。我的 html 看起来像这样:

<style>
.inline {
display: inline-block;
}
</style>

<table>
@for (int i = 0; i < 3; i++)
{
<tr>
<td>
<label>Tries</label>
<label class="ui-checkbox">
@Html.CheckBoxFor(m => m.Input.LockFixtureDates, new {@class = ""}) <span></span>
</label>
</td>
<td>
<label class="inline">Max points</label>
<div class="inline ">
@Html.TextBoxFor(m => m.Input.PointsForWalkover, new {@class = "form-control width-20", max = "", min = "0", type = "number", value = ""})
</div>
</td>
<td>
<label>Has bonus points</label>
<label class="ui-checkbox">
@Html.CheckBoxFor(m => m.Input.LockFixtureDates, new {@class = ""}) <span></span>
</label>
</td>
<td>
<div class="inline ">
@Html.TextBoxFor(m => m.Input.PointsForWalkover, new {@class = "form-control width-40", max = "", min = "0", type = "number", value = ""})
</div>
<label class="inline">bonus points for more than or equal to</label>
<div class="inline ">
@Html.TextBoxFor(m => m.Input.PointsForWalkover, new {@class = "form-control width-40", max = "", min = "0", type = "number", value = ""})
</div>

</td>
</tr>
}
</table>

最佳答案

<td>
<div class="inline ">
@Html.TextBoxFor(m => m.Input.PointsForWalkover, new {@class = "form-control width-40", max = "", min = "0", type = "number", value = ""})
</div>
<label class="inline">bonus points for more than or equal to</label>
<div class="inline ">
@Html.TextBoxFor(m => m.Input.PointsForWalkover, new {@class = "form-control width-40", max = "", min = "0", type = "number", value = ""})
</div>

</td>

将最后一个 td 更改为

  <td>
<div class="inline ">
@Html.TextBoxFor(m => m.Input.PointsForWalkover, new {@class = "form-control width-40", max = "", min = "0", type = "number", value = ""})
</div>
<label class="inline">bonus points for more than or equal to</label>

</td>
<td>
<div class="inline ">
@Html.TextBoxFor(m => m.Input.PointsForWalkover, new {@class = "form-control width-40", max = "", min = "0", type = "number", value = ""})
</div>
</td>

关于html - 表格 td 元素在错误的列下换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51875847/

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