兩個帶有預(yù)定義寬度的單元格:
<table border="1"> <tr> <thwidth="40%"
>Company in USA</th> <thwidth="60%"
>Address</th> </tr> <tr> <td>Apple, Inc.</td> <td>1 Infinite Loop Cupertino, CA 95014</td> </tr> <tr> <td>Google, Inc.</td> <td>1600 Amphitheatre Parkway Mountain View, CA 94043</td> </tr> </table>
width 屬性規(guī)定表格的表頭單元格的寬度。
通常,單元格占用的空間就是它顯示內(nèi)容需要的空間。width 屬性用于為單元格設(shè)置預(yù)定義的寬度。
盡管不贊成使用 width 屬性,但是所有瀏覽器都支持它。
在 HTML 4.01 中,不贊成使用 th 元素的 width 屬性;在 XHTML 1.0 Strict DTD 中,不支持 th 元素的 width 屬性。
請使用 CSS 代替。
CSS 語法:<th style="width:100px">
在我們的 CSS 教程中,您可以找到更多有關(guān) width 屬性 的細(xì)節(jié)。
<th width="value">
值 | 描述 |
---|---|
pixels | 以像素計的寬度值(比如 "100px")。 |
percent | 以包含元素百分比計的寬度值(比如 "20%")。 |
如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答!! 點(diǎn)擊進(jìn)入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號