Latest web development tutorials

HTML th nowrap 屬性

HTML th 標籤參考手冊 HTML <th>標籤

實例

帶有nowrap 屬性的表頭單元格:

<table border="1">
<tr>
<th>Month</th>
<th nowrap>My Savings for a new car</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>

嘗試一下»

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主流瀏覽器都支持nowrap 屬性。


定義和用法

HTML5不支持<th> nowrap屬性。 請使用CSS代替。

在HTML 4.01中,<th>的nowrap屬性已廢棄

nowrap 屬性是一個布爾屬性。

nowrap 屬性規定表頭單元格中的內容不換行。


兼容性註釋

在HTML 4.01 中,<th> 的nowrap 屬性已廢棄。 請使用CSS 代替。

CSS 語法:<th style="white-space: nowrap">

CSS實例:表頭單元格中不換行

在我們的CSS教程中,您可以找到更多有關white-space屬性的細節。


HTML 與XHTML 之間的差異

在XHTML 中,禁止屬性最小化,nowrap 屬性必須定義為<th nowrap="nowrap">。


語法

<th nowrap>


HTML th 標籤參考手冊 HTML <th>標籤