TD的noWrap属性使用注意事项
2008-01-19 13:05
295 查看
☆提出问题:
<td width="28%" align="right" nowrap >
我设置nowrap和不设置nowrap效果都一样。就是表格随着文字自动伸展,为什么?
→回答问题:
TD元素noWrap属性的行为与TD元素的width属性有关。
◆如果未设置TD宽度,则noWrap属性是起作用的。
◆如果设置了TD宽度,则noWrap属性是不起作用的。
示例文件,点击运行按钮,查看效果:
运行代码框
<html>
<head>
<title>wrap属性研究</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>测试字符串:</p>
<p>我终于明白,我其实有一条韧性十足的命,它远比我想象中的那条命结实得多、耐磨的多……</p>
<p>单元格未设置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>我终于明白,我其实有一条韧性十足的命,它远比我想象中的那条命结实得多、耐磨的多……</td>
</tr>
</table>
<p>单元格设置了nowrap属性,未设置width属性:</p>
<table width="100" border="1" cellspacing="0" cellpadding="0">
<tr>
<td nowrap>我终于明白,我其实有一条韧性十足的命,它远比我想象中的那条命结实得多、耐磨的多……</td>
</tr>
</table>
<p>单元格设置了nowrap属性,也设置了width属性:</p>
<table width="200" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="120" nowrap>我终于明白,我其实有一条韧性十足的命,它远比我想象中的那条命结实得多、耐磨的多……</td>
<td> </td>
</tr>
</table>
</body>
</html>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
<td width="28%" align="right" nowrap >
我设置nowrap和不设置nowrap效果都一样。就是表格随着文字自动伸展,为什么?
→回答问题:
TD元素noWrap属性的行为与TD元素的width属性有关。
◆如果未设置TD宽度,则noWrap属性是起作用的。
◆如果设置了TD宽度,则noWrap属性是不起作用的。
示例文件,点击运行按钮,查看效果:
运行代码框
<html>
<head>
<title>wrap属性研究</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>测试字符串:</p>
<p>我终于明白,我其实有一条韧性十足的命,它远比我想象中的那条命结实得多、耐磨的多……</p>
<p>单元格未设置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>我终于明白,我其实有一条韧性十足的命,它远比我想象中的那条命结实得多、耐磨的多……</td>
</tr>
</table>
<p>单元格设置了nowrap属性,未设置width属性:</p>
<table width="100" border="1" cellspacing="0" cellpadding="0">
<tr>
<td nowrap>我终于明白,我其实有一条韧性十足的命,它远比我想象中的那条命结实得多、耐磨的多……</td>
</tr>
</table>
<p>单元格设置了nowrap属性,也设置了width属性:</p>
<table width="200" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="120" nowrap>我终于明白,我其实有一条韧性十足的命,它远比我想象中的那条命结实得多、耐磨的多……</td>
<td> </td>
</tr>
</table>
</body>
</html>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
相关文章推荐
- TD的noWrap属性使用注意事项
- TD的noWrap属性使用注意事项
- TD的noWrap属性使用注意事项
- TD的noWrap属性使用注意事项 (有例子)
- TD的noWrap属性使用注意事项
- TD的noWrap属性使用注意事项
- td nowrap css nowrap使用说明于注意事项
- td nowrap css nowrap使用说明于注意事项
- 安卓中 选择器属性的使用,注意事项
- 垂直对齐:vertical-align属性——使用中注意事项
- IOS property属性详细介绍使用注意事项
- 在程序中使用自定义控件的自定义属性注意事项
- JS学习笔记2015-4-15(第二天)——属性操作的注意事项&中括号在JS中的使用
- 使用defer和async属性加载js脚本时的注意事项
- 使用kbmmw smart service 属性时的一个注意事项
- 关于android:layout_weight属性使用注意事项
- html td nowrap不换行属性使用方法
- 使用反射修改对象属性注意事项
- 使用angularjs中ng-repeat的$even与$odd属性时的注意事项
- ###Jsp+Servlet购物商城day04.3:订单模块Order实体设计失误。【Bean属性设计两大原则】-MyBeanUtils使用注意事项。