| Depr. | Version |
|---|---|
| Yes | HTML 3.2 |
| IE5.5+ | FF1+ | SA1.3+ | OP9.2+ | CH2+ |
|---|---|---|---|---|
| Full | Full | Full | Full | Full |
Syntax
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>
Example
Here, the td
contents are set not to wrap:
<td nowrap="nowrap">+44 01793 001100</td>
Value
"nowrap" is the
only value this attribute can take.
Compatibility
| Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 8.0 | 1.0 | 1.5 | 2.0 | 3.0 | 3.5 | 1.3 | 2.0 | 3.1 | 4.0 | 9.2 | 9.5 | 10.0 | 2.0 |
| Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | 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.