English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML: <th> nowrap attribute

The nowrap attribute is a boolean attribute. The nowrap attribute specifies that the content in the header cells does not wrap.

 HTML <th> tag

Online Example

Header cells with nowrap attribute:

<table style="width:100%" border="1">
  <tr>
    <th>Year</th>
    <th nowrap>Save money to buy a house</th>
  </tr>
  <tr>
    <td>2018</td>
    <td>$15320.00</td>
  </tr>
  <tr>
    <td>2019</td>
    <td>$18320.00</td>
  </tr>
</table>
Test to see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the nowrap attribute.

Definition and Usage

HTML5 The nowrap attribute of <th> is not supported. Please use CSS instead.

In HTML 4.01 In HTML, the nowrap attribute of <th> is deprecated.

The nowrap attribute is a boolean attribute.

The nowrap attribute specifies that the content of the table header cell does not wrap.

Compatibility Comments

In HTML 4.01 In this case, the nowrap attribute of <th> is deprecated. Please use CSS instead.

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

CSS Example: Table header cell without line break

You can find more aboutwhite-space attribute . Details.

Differences between HTML and XHTML

In XHTML, attribute shorthand is prohibited, the nowrap attribute must be defined as <th nowrap="nowrap">.

Syntax

<th nowrap>
 HTML <th> tag