nowrap (HTML attribute)
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
| IE | 5.5 | Full |
|---|---|---|
| 6.0 | Full | |
| 7.0 | Full | |
| Firefox | 1.0 | Full |
| 1.5 | Full | |
| 2.0 | Full | |
| Safari | 1.3 | Full |
| 2.0 | Full | |
| 3.0 | Full | |
| Opera | 9.2 | Full |
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.

