gpt4 book ai didi

html - 设置 HTML 表格列宽不生效

转载 作者:太空宇宙 更新时间:2023-11-03 18:38:12 25 4
gpt4 key购买 nike

我有一些表格坚持列的宽度应该相同,我该如何指定它们?

明确一点,我希望最左边的列变窄,以便其他标题可以放在一行上

代码示例

<div>
<table style="width:610px;border-style:inset; border:1px; border-color:#000000; padding:3px;">
<tr class="propGridHeader">
<td style="width:150px!important;border:1px;border-style:inset;border-color:#000000;text-align:left;">Records: <asp:Label ID="lblHourCount" runat="server" /></td>
<td style="width:153.3px;border:1px;border-style:inset;border-color:#000000;text-align:center;">Fixed Price</td>
<td style="width:153.3px;border:1px;border-style:inset;border-color:#000000;text-align:center;">Liquidated Heat Rate</td>
<td style="width:153.3px;border:1px;border-style:inset;border-color:#000000;text-align:center;">Liquidated Spark Spread</td>
</tr>
<tr>
<td style="width:150px!important;border:1px;border-style:inset;border-color:#000000;" class="propDarkGrid">Average</td>
<td style="width:153.3px;border:1px;border-style:inset;border-color:#000000;text-align:right;" class="propLightGrid"><asp:Label id="lblHourAvgFP" runat="server" /></td>
<td style="width:153.3px;border:1px;border-style:inset;border-color:#000000;text-align:right;" class="propLightGrid"><asp:Label id="lblHourAvgHR" runat="server" /></td>
<td style="width:153.3px;border:1px;border-style:inset;border-color:#000000;text-align:right;" class="propLightGrid"><asp:Label id="lblHourAvgSS" runat="server" /></td>
</tr>

最佳答案

您不能以像素为单位使用小数。只需使用 style="width:153px;border:1px

enter image description here

关于html - 设置 HTML 表格列宽不生效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18219954/

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