gpt4 book ai didi

css - 根据条件在 Table 之间添加空格

转载 作者:行者123 更新时间:2023-11-28 11:33:44 26 4
gpt4 key购买 nike

我根据从模型和示例 View 收到的数据在我的 mvc View 中动态形成行和列,如下所示

for(...)
{
<tr>

if()
{
<td>
---Dynamic content
</td>
elseif()
{
<td>
---Dynamic content
</td>
}
else()
{
<td>
---Dynamic content
//In case of else execution i need to add space for the next formed <tr>
</td>
}
}
</tr>
}

我正在根据某些特定条件形成表格行,并且一切正常,在上面的代码中,我需要<tr> 添加空间 在 else block 的情况下 <td > 形成。

如果 else 阻止执行,它将进入下一个 <tr 的形式> 我需要以某种方式在 <tr> 之前添加一个空格形成。

代码看起来乱七八糟,有表格和循环,但想要一个解决方案,如何在 <tr> 之间动态添加空间根据条件。

谢谢

最佳答案

怎么样……?

else()
{
<td><!-- use this as a spacer row --></td>
</tr>
<tr>
<td>
---Dynamic content
//In case of else execution i need to add space for the next formed <tr>
</td>
}

关于css - 根据条件在 Table <tr> 之间添加空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21019441/

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