2013-02-19 87 views

回答

1

您需要使用屬性colspanth

<tr> 
     <th>Table header</th> 
     <th colspan="5">Table header</th> 
    </tr> 
    <tr> 
     <th>&nbsp; <!-- EMPTY --></th> 
     <th>Minor</th> 
     <th>Lorem 1</th> 
     <th>Lorem 2</th> 
     <th>Lorem 3</th> 
     <th>Lorem 4</th> 
    </tr> 
    <tr> 
     <th>Almost Certain</th> 
     <td>Table cell 1</td> 
     <td>Table cell 2</td> 
     <td>Table cell 3</td> 
     <td>Table cell 4</td> 
     <td>Table cell 5</td> 
    </tr> 

的jsfiddle:http://jsfiddle.net/nPQfz/

+0

我有同樣的問題,並且colspan解決了它。但所有​​都有相同的寬度,如何改變? – ThiagoPonte 2013-02-21 17:51:38

1

使用表格標題th並添加colspan屬性,第二個標題跨越5列:

<tr> 
    <th>Likelyhood</th> 
    <th colspan="5">Consequence</th> 
</tr> 

Updated jsfiddle

+0

具有複雜表這樣它也有幫助(從可訪問性的觀點來看)到'scope'屬性添加到'th'元件('範圍=「行/山坳「')。 – steveax 2013-02-19 17:22:04

相關問題