2016-12-20 35 views
-2

我希望單個單元格中有兩行。如何在使用html的單個單元格中添加兩行

https://i.stack.imgur.com/i2ASb.png

這是我寫的代碼。我用rowspan來增加單元格寬度。

<tr> 
    <th rowspan="2">Questions</th> 
    <th>sub1</th> 
    <th>sub2</th> 
    <th>sub3</th> 
    <th>sub4</th> 
    <th>sub5</th> 
    <th>sub6</th> 
</tr> 

我試圖添加工作人員,但我沒有得到我想要的方式。

+1

添加兩行是什麼問題? –

+0

你正在尋找什麼輸出?請更新問題。 – Spidey

回答

0

這樣你可以在一個單元格使用HTML

<tr> 
    <th> 
    <table> 
     <tr> 
     <td>sub1</td> 
     <td>sub2</td> 
    </tr> 
    <tr> 
     <td>sub3</td> 
     <td>sub4</td> 
    </tr> 
    </table> 
</th> 
<th rowspan="2">Questions</th> 
<th>sub1</th> 
<th>sub2</th> 
<th>sub3</th> 
<th>sub4</th> 
<th>sub5</th> 
<th>sub6</th> 
</tr> 
+0

非常感謝你的解決方案@awadhesh – Manasa

相關問題