nowrap是什么意思?
HTML中td元素的nowrap屬性表示禁止單元格中的文字自動(dòng)換行。
但使用時(shí)要注意的是,td元素noWrap屬性的行為與td元素的width屬性有關(guān)。td元素中nowrap屬性的行為與td元素的width屬性有關(guān)。如果未設(shè)置td寬度,則nowrap屬性起作用的,如果設(shè)置了td寬度,則nowrap屬性不起作用。
nowrap詳細(xì)解說
nowrap表示是否允許表格中的文本換行
nowrap=true的時(shí)候不能換行
nowrap=false可以換行
nowrap實(shí)例演示
<html>
<head>
<title>wrap屬性研究</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>測試字符串:</p>
<p>我終于明白,我其實(shí)有一條韌性十足的命,它遠(yuǎn)比我想象中的那條命結(jié)實(shí)得多、耐磨的多……</p>
<p>單元格未設(shè)置nowrap屬性的空表:</p>
<table width="100" border="1" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<p>加入測試字符串:</p>
<table width="100" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>我終于明白,我其實(shí)有一條韌性十足的命,它遠(yuǎn)比我想象中的那條命結(jié)實(shí)得多、耐磨的多……</td>
</tr>
</table>
<p>單元格設(shè)置了nowrap屬性,未設(shè)置width屬性:</p>
<table width="100" border="1" cellspacing="0" cellpadding="0">
<tr>
<td nowrap>我終于明白,我其實(shí)有一條韌性十足的命,它遠(yuǎn)比我想象中的那條命結(jié)實(shí)得多、耐磨的多……</td>
</tr>
</table>
<p>單元格設(shè)置了nowrap屬性,也設(shè)置了width屬性:</p>
<table width="200" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="120" nowrap>我終于明白,我其實(shí)有一條韌性十足的命,它遠(yuǎn)比我想象中的那條命結(jié)實(shí)得多、耐磨的多……</td>
<td> </td>
</tr>
</table>
</body>
</html>
如對本文有疑問,請?zhí)峤坏浇涣髡搲瑥V大熱心網(wǎng)友會為你解答?。?點(diǎn)擊進(jìn)入論壇