在调整单元格宽度时,如果单元格内有汉字或多个单词长度>tdwidth时,会出现自动换行,即使<td nwrap>,我现在必须<td><span nowrap>...</s
在调整单元格宽度时,如果单元格内有汉字或多个单词,会出现自动换行!
即使<td nwrap>,我现在必须<td><span nowrap>...</span></td>
若我的表格是20*100则在表格初始化时要插入2000个元素,感觉很不科学,,请问有何解决办法?
问题点数:0、回复次数:8Top
1 楼net_lover(【孟子E章】)回复于 2003-12-02 20:43:53 得分 0
<td><nobr></nobr></td>Top
2 楼gen2(踏雪观月)回复于 2003-12-02 20:57:20 得分 0
这不是我想要的,这与我上面说的方法没什么两样呀!依然要插入2000个元素!如果我在htc里面加上这个别人不是要用tbUniqeID.rows[i].cells[j].children[0]才能访问到原来tbUniqeID.rows[i].cells[j]的内容?Top
3 楼yeefly(丰水犁)回复于 2003-12-02 21:12:37 得分 0
Care should be taken when the noWrap property is used in conjunction with the width attribute of table or td elements.
Wordwrap still occurs in a td element that has its WIDTH attribute set to a value smaller than the unwrapped content of the cell, even if the noWrap property is set to true. Therefore, the WIDTH attribute takes precedence over the noWrap property in this scenario.
If a td element has its noWrap set to true and the WIDTH attribute of its table element is set to a smaller dimension than the rendered content of the td element, wordwrap does not occur. In this case, the noWrap setting takes precedence over the WIDTH attribute.
因此你的 td 不能设置宽度
如果你在做datagrid效果 可以设置table.style.tableLayout="fixed"
Top
4 楼alexzhang00(三角猫)回复于 2003-12-02 21:22:39 得分 0
<table style="word-break:break-all">
Top
5 楼gen2(踏雪观月)回复于 2003-12-02 21:53:28 得分 0
我是希望它不自动换行!!
如果<table style="word-break:keep-all">如果两个单词间有空格,单元格内容还是自动换行了,难道真的只有在TD里加上<span nowrap>之类了吗?
Top
6 楼gen2(踏雪观月)回复于 2003-12-02 22:01:48 得分 0
table.style.tableLayout="fixed"
table.style.workBreak="keep-all"
已设!!Top
7 楼gen2(踏雪观月)回复于 2003-12-03 10:25:58 得分 0
upTop
8 楼xuzuning(唠叨)回复于 2003-12-03 11:57:48 得分 0
你是想让多出来的不显示吗?Top




