2016-07-28 14 views
1

我想要設計表html,將有不同的高度td只使用一個表。可能嗎?如果可能,我怎麼才能完成它?如何可能在表td有不同的高度使用一個表

<table> 
    <tbody> 
     <td>height:30px</td> 
     <td>height:90px</td> 
     <td>height:60px</td> 
     <td>height:80px</td> 
    </tbody> 
</table> 

事情是這樣的表:

enter image description here

+0

問題是,你的「表」是不是表 –

+1

使用div標籤的安排,是更好地爲您 –

+1

div的使用,而不是表,作爲@MarkPerera提到的,這種情況下你的表是不是表 –

回答

0
<style> 
tr { 
height: auto; 
} 
td { 
overflow: hidden; 
display: inline-block; 
white-space: nowrap; 
vertical-align: top; 
background-color: #3399ff; 
height: 100%; 
width: 75px; 
border: 1px solid black; 
} 
td:nth-child(odd) { 
background-color: #1177dd; 
} 
#b { 
height: 200px; 
} 
#j { 
height: 90px; 
} 
#k { 
height: 180px; 
} 
</style> 

<table> 
<tbody> 
<tr> 
<td id="b">b</td> 
<td id="j">j</td> 
<td id="k">k</td> 
</tr> 
</tbody> 
</table> 
0

財產以後這樣應該做的伎倆:

<td style="height: 30px"></td> 

對於HTML造型任何你需要使用的風格標籤,你想的風格,那麼什麼,
或鏈接到一個單獨的css文件表TD標籤內

+0

但通過使用這個所有tds在相同的高度,我想在一個tr不同的td高度 –

0

div的使用或轉換所有代碼的DIV而不是表

<table> 
     <tbody> 
      <td><div "height:30"></div> <div "height:40"></div> <div "height:60">  </div></td> 
     </tbody> 
    </table> 
相關問題