gpt4 book ai didi

css - 小型 HTML 表格问题

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

我有这张图片中显示的上表。我想修复吉尔和史密斯之间的空间。以最后一张表为例。不知道如何解释,因为英语不是我的母语。

http://i.stack.imgur.com/IC4CP.png

编辑

我的代码

  <table>
<tr>
<th>Jill</td>
<th>Smith</td>
<th>Santa</td>
</tr>
<tr>
<td>Jill</td>
<td>Smith5555</td>
<td>50555555555</td>
</tr>
<tr>
<td>Jillffff</td>
<td>Smith5555</td>
<td>50555555555</td>
</tr>
<tr>
<td>Jill5555</td>
<td>Smith5555</td>
<td>50555555555</td>
</tr>
</table>

CSS

table, th, td {
width:100%;
border:1px solid #ddd;
padding:10px;
}
table {
border-collapse:collapse;
}
table td {
font-size:13px;
}
table th {
text-align:left;
font-size:14px;
text-transform:uppercase;
font-weight:normal;
background:#36c;
color:#fff;
}
tr:nth-child(odd) {
background-color: #f2f2f2;
}

最佳答案

这就是你的问题所在,

 table, th, td {
width:100%; //This makes your table too big
border:1px solid #ddd;
padding:10px;
}

我会说删除宽度属性,您的表格应该没问题:)

这是你的 CSS 代码

关于css - 小型 HTML 表格问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34320074/

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