Precautions for using TD nowrap CSS nowrap

Source: Internet
Author: User

Raise questions:
<TD width = "28%" align = "right" nowrap>
I set nowrap and do not set nowrap to the same effect. That is, the table automatically stretches with the text. Why?

→ Answer questions:
The behavior of the nowrap attribute of the TD element is related to the width attribute of the TD element.

◆ If the TD width is not set, the nowrap attribute works.
◆ If the TD width is set, the nowrap attribute does not work.

For the sample file, click Run to view the effect:<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"> <p> test string: </P> <p> I finally understand, in fact, I have a tough life, which is far more powerful and wearable than I imagined ...... </P> <p> the cell does not have an empty table with the nowrap attribute set: </P> <Table width = "100" border = "1" cellspacing = "0" cellpadding = "0"> <tr> <TD> </tr> </table> <p> Add a test string: </P> <Table width = "100" border = "1" cellspacing = "0" cellpadding = "0"> <tr> <TD> I finally understand, in fact, I have a tough life, which is far more powerful and wearable than I imagined ...... </TD> </tr> </table> <p> the cell has set the nowrap attribute, and the width attribute is not set: </P> <Table width = "100" border = "1" cellspacing = "0" cellpadding = "0"> <tr> <TD nowrap> I finally understand, in fact, I have a tough life, which is far more powerful and wearable than I imagined ...... </TD> </tr> </table> <p> the cell has set the nowrap attribute and the width attribute: </P> <Table width = "200" border = "1" cellspacing = "0" cellpadding = "0"> <tr> <TD width = "120" nowrap> me finally understand, in fact, I have a tough life, which is far more powerful and wearable than I imagined ...... </TD> </tr> </table> <p>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.