gpt4 book ai didi

html - 连续html中的一些行

转载 作者:行者123 更新时间:2023-11-28 05:23:08 24 4
gpt4 key购买 nike

我想要如图所示的表格,我尝试合并单元格但没有成功。这是我没有合并的代码:

I want table such like that as show in image, I tried to merge cells but not succeed. here is my code without merging.

.tftable {margin: 10px auto;font-size:12px;color:#333333;width:auto;border-width: 1px;border-color: #5e823a;border-collapse: collapse;}
.tftable th {font-weight: 800;font-size:24px;background-color:#46622a;border-width: 2px;padding: 8px;border-style: solid;border-color: #5e823a;text-align:left;color: #fcfcfc;}
.tftable tr {background-color:#88b35d;}
.tftable td {font-weight: 600;font-size:18px;border-width: 2px;padding: 8px;border-style: solid;border-color: #5e823a;}
<table class="tftable" border="1">
<tr>
<th>SuperVisors</th>
</tr>
</table>
<table class="tftable" border="1">
<tr>
<th>Armina</th>
<th>Saleen</th>
<th>Julia</th>
<th>Samina</th>
</tr>
<tr>
<td><img src="http://www.dhresource.com/albu_962922772_00/1.200x200.jpg" alt="Super Visors" height="200" width="200"></td>
<td><img src="http://www.dhresource.com/albu_962922772_00/1.200x200.jpg" alt="Super Visors" height="200" width="200"></td>
<td><img src="http://www.dhresource.com/albu_962922772_00/1.200x200.jpg" alt="Super Visors" height="200" width="200"></td>
<td><img src="http://www.dhresource.com/albu_962922772_00/1.200x200.jpg" alt="Super Visors" height="200" width="200"></td>
</tr>
</table>

最佳答案

简单。 colspan属性:

.tftable {margin: 10px auto;font-size:12px;color:#333333;width:auto;border-width: 1px;border-color: #5e823a;border-collapse: collapse;}
.tftable th {font-weight: 800;font-size:24px;background-color:#46622a;border-width: 2px;padding: 8px;border-style: solid;border-color: #5e823a;text-align:left;color: #fcfcfc;}
.tftable tr {background-color:#88b35d;}
.tftable td {font-weight: 600;font-size:18px;border-width: 2px;padding: 8px;border-style: solid;border-color: #5e823a;}
<table class="tftable" border="1">
<thead>
<tr>
<th colspan="4">SuperVisors</th>
</tr>
<tr>
<th>Armina</th>
<th>Saleen</th>
<th>Julia</th>
<th>Samina</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="http://www.dhresource.com/albu_962922772_00/1.200x200.jpg" alt="Super Visors" height="200" width="200"></td>
<td><img src="http://www.dhresource.com/albu_962922772_00/1.200x200.jpg" alt="Super Visors" height="200" width="200"></td>
<td><img src="http://www.dhresource.com/albu_962922772_00/1.200x200.jpg" alt="Super Visors" height="200" width="200"></td>
<td><img src="http://www.dhresource.com/albu_962922772_00/1.200x200.jpg" alt="Super Visors" height="200" width="200"></td>
</tr>
</tbody>
</table>

备注<tbody><thead>标签。

关于html - 连续html中的一些行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38932700/

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