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>