如何阻止动态数据超出表的溢出?
这是一个Struts 应用程序。 我必须在左侧面板中显示从数据库或任何会话对象(例如注释)检索的动态日期。 如果单词之间有空格,那么它就可以正常工作。 但是,在测试我是否输入一些没有空格的字符时,在左侧面板中显示数据时,数据会穿过表格并出现在 IE8、Mozilla 和 chrome 的主面板上。
我的部分示例代码是这样的。
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="fixedTable">
<tr>
<td class="normalTxt" width="100" style="text-align:left;"
bean:write name="cNotesInfo" property="description" />
</td>
</tr>
</table>
请任何解决方案。
我已经删除了 //>符号使您输入代码。
It's a Struts application.
I have to show some dynamic date in the left hand panel retrieving from DB or any session object e.g Notes.
If there is space between words then its working fine.
But while testing if I am entering some characters without space, then while showing the data in Left hand panel is crossing the table and coming on main panel in IE8, Mozilla and chrome also.
My part of sample code is like this.
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="fixedTable">
<tr>
<td class="normalTxt" width="100" style="text-align:left;"
bean:write name="cNotesInfo" property="description" />
</td>
</tr>
</table>
Any solution please.
I have removed the < / > symbol to make U sho the code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在渲染到屏幕之前向数据添加一个空格。
<代码>
IE 5.5+、Firefox 3.5+ 以及 WebKit 浏览器(例如 Chrome 和 Safari)支持自动换行。
<代码>
One important note - if the element has a fixed width this approach works well. However if you have width 100% this doesn’t do the job
You could add a space to your data before rendering to the screen.
Also there is this for selected browsers.. Word-wrap is supported in IE 5.5+, Firefox 3.5+, and WebKit browsers such as Chrome and Safari.
One important note - if the element has a fixed width this approach works well. However if you have width 100% this doesn’t do the job