gpt4 book ai didi

jquery - 为表格中的不同 td 提供不同的宽度

转载 作者:行者123 更新时间:2023-11-28 04:45:28 25 4
gpt4 key购买 nike

我正在创建一个 Web 应用程序,我想要一个包含多个 <tr> 的表格和 <td>

这是我的代码

<tr>
<th style="width:30px;">date</th>
</tr>
<tr>
<td>10-10-2016</td>
</tr>

在我添加另一个 tr 之前它工作正常

<tr>
<td style="width:200px;">Expense incurred towards sessions</td>
</tr>

它正在增加我的 date(th,td) 的宽度,否则它会向我显示其他类似的 td

Expense

incurred

towards

sessions

我不想增加日期 td 的宽度,但希望我的第二个 td 在同一行上

Expense incurred towards sessions

像这样我需要如何CSS

这是我的 table

<table id="table" ng-hide="hidetable" class="table font" style="width:100%;
margin-top:30px; padding-top:10px;">

最佳答案

这是否与您所追求的相似? Here is more在用于实现此目的的 colspan="" 属性上。

<table id="table" ng-hide="hidetable" class="table font" style="width:100%;
margin-top:30px; padding-top:10px;">
<tr>
<th style="width:30px;background-color:#f2f2f2;">date</th>
<td style="background-color:#f2f2f2;">10-10-2016</td>
</tr>
<tr>
<td colspan="2" style="background-color:#f2f2f2;">Expense incurred towards sessions</td>
</tr>
</table>

关于jquery - 为表格中的不同 td 提供不同的宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40988705/

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