THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML <th> nowrap Attribute

HTML th Reference HTML <th> tag

Example

A header cell with a nowrap attribute:

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

Definition and Usage

The nowrap attribute is a boolean attribute.

When present, it specifies that the content inside a header cell should not wrap.


Browser Support

Attribute
nowrap Yes Yes Yes Yes Yes

Compatibility Notes

The nowrap attribute of <th> is not supported in HTML5. Use CSS instead.

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

CSS Example: No word-wrapping in header cell

In our CSS tutorial you can find more details about the white-space property.


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 Reference HTML <th> tag