td標籤不換行CSS寫法

HTML <td> 標籤的 nowrap 屬性

定義和用法

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

實例

帶有 nowrap 屬性的表格單元:

<table border="1">
  <tr>
    <th>Poem</th>
    <th>Poem</th>
  </tr>
  <tr>
    <td nowrap="nowrap">Never increase, beyond what is necessary, the 
	number of entities required to explain anything</td>
    <td>Never increase, beyond what is necessary, the number of entities 
	required to explain anything</td>
  </tr>
</table>

TIY

瀏覽器支持

儘管不贊成使用 nowrap 屬性,但是所有瀏覽器都支持它。

兼容性註釋

在 HTML 4.01 中,不贊成使用 td 元素的 nowrap 屬性;在 XHTML 1.0 Strict DTD 中,不支持 td 元素的 nowrap 屬性。

請使用 CSS 代替。

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

CSS 實例:td 中不換行

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

語法

<td nowrap="value">

屬性值

描述
nowrap 規定表格單元格中的內容不換行。
 
 
發佈了95 篇原創文章 · 獲贊 40 · 訪問量 88萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章