2011-12-16 78 views
-1

我有一個表像這樣:用自己的寬度TD元素

<table class="data"> 
    <thead> 
    <tr class="columns"> 
     <th> 
     </th> 
     <th> 
      <h2>Title</h2> 
     </th> 
     <th> 
      <h2>Location</h2> 
     </th> 
     <th> 
      <h2>Download</h2> 
     </th> 
     <th> 
      <h2>Analytics</h2> 
     </th> 
     <th> 
      <h2>Uploaded</h2> 
     </th> 
     <th> 
      <h2>Updated</h2> 
     </th> 
    </tr> 
    <thead> 
    <tbody> 
    <form> 
    <tr class="row"> 
     <td><input type="checkbox" name="ID" value="1" /></td> 
     <td>Some Title</td> 
     <td>Some Url</td> 
     <td>Some Url</td> 
     <td>view Analytics</td> 
     <td>Some person</td> 
     <td>Some info</td> 
    </tr> 
    <tr class="row"> 
     <td><input type="checkbox" name="ID" value="2" /></td> 
     <td>Some Title</td> 
     <td>Some Url</td> 
     <td>Some Url</td> 
     <td>view Analytics</td> 
     <td>Some person</td> 
     <td>Some info</td> 
    </tr> 
    </form> 
    <tbody> 
</table> 

我想插入另一個包含td s的表(只是</form>標籤後)的底部tr,但我不知道希望它們的寬度受其影響,或者影響其上方的其他td

該表格沒有設置寬度和大小的內容。

我該怎麼辦?

+1

你不能隨意在表格中粘貼`form`標籤。把它們放在「TD」或桌子外面 – Jakub 2011-12-16 15:33:28

回答

0

添加另一個表中的最後一個單元格:

<tr> 
    <td colspan="6"> 
     <table> 
      <tr> 
       <td></td> 
       <td></td> 
       <td></td> 
       <td></td> 
       <td></td> 
       <td></td> 
       <td></td> 
       <td></td> 
      </tr> 
     </table> 
    </td> 
</tr> 
0

你不能這樣做,除非你添加<tr>,將所有<td> -s成一個(合併單元格)中,並把嵌套表內部的<td> - 在新表中,您可以設置您的<td> -s寬度

-1

請參閱colspan和rowspan屬性。要完全靈活,您應該在上表中創建另一個表格。製作上面的表格style =「margin:0;」下面的表格有類似於style =「margin:0; position:relative; top:-2」的字樣,使它看起來像是連接起來的。雖然這看起來是相同的跨瀏覽器,但這會很棘手。