You are here: Reference > HTML > attributes > NOWRAP (body, dd, div, dt, td, th)

NOWRAP attribute (body, dd, div, dt, td, th)

Browser support:
Specifies whether the text in a table cell can be wrapped.
This attribute is deprecated. Use the white-space or the word-wrap attributes instead.
JavaScript page for this attribute: noWrap. You can find other example(s) there.

Possible values:

This attribute has no values.
Specifying the NOWRAP attribute with an arbitrary value has the same effect as specifying it with no value.
For example, all of the following declarations have the same effect: nowrap, nowrap="true", nowrap="false", nowrap="on", nowrap="nowrap".
Although Boolean attributes may be used with no value in HTML, for XHTML compatibility, always use the NOWRAP attribute in the following format: nowrap="nowrap".

Example HTML code 1:

This example illustrates the use of the noWrap attribute:
<div style="width:150px;">
    <table border="1px" cellpadding="3px">
        <tr>
            <td nowrap="nowrap">The contents of this cell cannot be wrapped. The contents of this cell cannot be wrapped.</td>
        </tr>
    </table>
</div>
<div style="width:150px;">
    <table border="1px" cellpadding="3px">
        <tr>
            <td>The contents of this cell can be wrapped. The contents of this cell can be wrapped.</td>
        </tr>
    </table>
</div>
Did you find this example helpful? yes no

Example HTML code 2:

Recommendation:
<div style="width:150px;">
    <table border="1px" cellpadding="3px">
        <tr>
            <td style="white-space:nowrap;">The contents of this cell cannot be wrapped. The contents of this cell cannot be wrapped.</td>
        </tr>
    </table>
</div>
<div style="width:150px;">
    <table border="1px" cellpadding="3px">
        <tr>
            <td>The contents of this cell can be wrapped. The contents of this cell can be wrapped.</td>
        </tr>
    </table>
</div>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content