HTML <th> nowrapProperty

HTML <th> Tag

Example

Table header cell with the nowrap attribute:

<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>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the nowrap attribute.


Definition and Usage

HTML5 does not support the <th> nowrap attribute. Use CSS instead.

The nowrap attribute of <th> in HTML 4.01Deprecated。

The nowrap attribute is a boolean attribute.

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


Compatibility Notes

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

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

CSS Example: No Line Break in Table Header Cell

In our CSS tutorial, you can find more information aboutwhite-space PropertyDetails.


Differences between HTML and XHTML

In XHTML, attribute minimization is forbidden, and the nowrap attribute must be defined as <th nowrap="nowrap">.


Syntax

<th nowrap>


HTML <th> Tagother extensions