2010-10-19 19 views
0

我有固定寬度列的表:固定寬度的HTML表中的兩個級別的行<thead>?

<table width="100%" cellpadding="0" cellspacing="0"> 
    <thead> 
     <tr> 
      <th>Title</th> 
      <th>Description</th> 
      <th>Hours</th> 
      <th>Rate</th> 
     </tr> 
    </thead> 
    <tbody> 
     <tr> 
      <td style="width:100px"></td> 
      ... 
    </tbody> 
</table> 

這很好,但現在我想有說明出現在下面的橫線「標題,時間,速度」,以便它可以更長,大概寬度的表格。事情是這樣的:

| Title | Hours | Rate | 
------------------------------------------ 
| A title  | Some hours | A rate  | <- This is a row 
| A long description would go here... | <- This is the same row 
------------------------------------------ 
So on... 

我仍想稱其爲表中的一個「行」。這只是一個顯示偏好。我需要做什麼才能做到這一點?

回答

3

Colspan會做你想做的事。

<tr> 
    <td></td> 
    <td></td> 
    <td></td> 
    <td></td> 
</tr> 
<tr> 
    <td colspan="4">long description</td> 
</tr> 
+1

HTML基礎FTW!確實是 – roflwaffle 2010-10-19 18:22:39

+0

2010-10-19 19:06:26