datalist中绑定数据,数据过长,不能自动换行,把单元格撑的变形,球解决办法!!!
datalist中绑定数据,数据过长,不能自动换行,把单元格撑的变形。
<asp:datalist id= "dlMsgs " runat= "server " Width= "100% " RepeatColumns= "1 " ShowHeader= "False " ShowFooter= "False "HorizontalAlign= "Center ">
<ItemTemplate>
<TABLE borderColor= "#ccffff " cellSpacing= "0 " cellPadding= "0 " width= "100% " align= "center " border= "1 ">
<TR vAlign= "top ">
<TD vAlign= "middle " align= "center " width= "20% " rowSpan= "3 ">
<%# DataBinder.Eval(Container.DataItem, "UserID ") %>
</TD>
<TD align= "left " width= "80% "> 标题:
<%# DataBinder.Eval(Container.DataItem, "MessageTitle ") %>
</TD>
</TR>
<TR vAlign= "top ">
<TD align= "left " width= "80% "> 内容:
<%# DataBinder.Eval(Container.DataItem, "MessageContent ") %>
</TD>
</TR>
</TABLE>
</ItemTemplate>
</asp:datalist>
还有lable绑定的数据也书过长,把单元格撑的变形。
我在网上看到有些帖子说要写一个css来控制,那应该这么做啊?
有别的办法的请帮忙搞定!!!
先谢谢了!!!
------解决方案--------------------在TABLE里添加style= "WORD-BREAK: break-all; WORD-WRAP: break-word " 就OK!
www.ezcom.cn里我在首业上就是这么做的!
<TABLE id= "Table2 " style= "WORD-BREAK: break-all; WORD-WRAP: break-word " cellSpacing= "0 "cellPadding= "0 " width= "450 " border= "0 ">
------解决方案--------------------就是lable自动换行的问题
可以吧lable调高或者在td里面写上 nowrap=nowrap试试