【发布时间】:2019-11-19 16:49:05
【问题描述】:
我有一个三列的表。但我需要第 9 行,第 1 列和第 3 列将分成 2 列。我有一些 stackoverflow 答案,但这些并没有解决我的问题。我想要如下图最后一行:
.tg {
border-collapse: collapse;
border-spacing: 0;
margin: 0px auto;
}
.tg td {
font-family: Arial, sans-serif;
font-size: 14px;
padding: 12px 85px;
border-style: solid;
border-width: 1px;
overflow: hidden;
word-break: normal;
border-color: black;
}
.tg th {
font-family: Arial, sans-serif;
font-size: 14px;
font-weight: normal;
padding: 12px 85px;
border-style: solid;
border-width: 1px;
overflow: hidden;
word-break: normal;
border-color: black;
}
.tg .tg-0pky {
border-color: inherit;
text-align: left;
vertical-align: top
}
<table class="tg">
<tr>
<th class="tg-0pky">Applicants</th>
<th class="tg-0pky"></th>
<th class="tg-0pky">Joint Applicants</th>
</tr>
<tr>
<td class="tg-0pky"></td>
<td class="tg-0pky">Current last name or single name</td>
<td class="tg-0pky"></td>
</tr>
<tr>
<td class="tg-0pky"></td>
<td class="tg-0pky">First and middle names</td>
<td class="tg-0pky"></td>
</tr>
<tr>
<td class="tg-0pky"></td>
<td class="tg-0pky">Marital Status</td>
<td class="tg-0pky"></td>
</tr>
<tr>
<td class="tg-0pky">Country of divorce</td>
<td class="tg-0pky" rowspan="3">If divorced</td>
<td class="tg-0pky">Country of divorce</td>
</tr>
<tr>
<td class="tg-0pky">City of divorce if in Canada</td>
<td class="tg-0pky">City of divorce if in Canada</td>
</tr>
<tr>
<td class="tg-0pky">Court file number</td>
<td class="tg-0pky" colspan="2">Court file number</td>
</tr>
<tr>
<td class="tg-0pky"></td>
<td class="tg-0pky">Religious denomination</td>
<td class="tg-0pky"></td>
</tr>
<tr>
<td class="tg-0pky"></td>
<td class="tg-0pky">Age and date of birth</td>
<td class="tg-0pky"></td>
</tr>
<tr>
<td class="tg-0pky"></td>
<td class="tg-0pky">Place of birth</td>
<td class="tg-0pky"></td>
</tr>
</table>
【问题讨论】:
-
所以这意味着你想将行拆分为列
-
@Ibnelaiq 表示一列将拆分为 2 列
-
@LockeDonohoe 不,我试过但无法解决我的问题。
标签: html css html-table