Skip to: content, navigation

by Ian Lloyd

nowrap (HTML attribute)

Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Full Full Full Full
Spec
Depr. Version
Yes HTML 3.2
nowrap="nowrap"

Example

Here, the td contents are set not to wrap:

<td nowrap="nowrap">+44 01793 001100</td>

Description

If you need to ensure that the contents of a cell always remains as they are, and don’t wrap, use the nowrap attribute. You might use nowrap in a table cell that contains a telephone number which may contain one or more spaces, but should be output on one line to ensure clarity.

Note that this attribute, which is now deprecated, has a much better alternative in the form of the CSS property white-space (which can be set to "nowrap").

The example HTML shows the nowrap attribute used in an XHTML-compliant way, but it could equally be expressed in HTML 4.01 as follows:

<td nowrap>+44 01793 001100</td>

Value

"nowrap" is the only value this attribute can take.

Compatibility

IE5.5Full
6.0Full
7.0Full
Firefox1.0Full
1.5Full
2.0Full
Safari1.3Full
2.0Full
3.0Full
Opera9.2Full

Excellent browser support is provided, but given that this is a deprecated attribute, you should opt for the CSS alternative instead (td {white-space:nowrap}).

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters