不换行: word-break:keep-all;word-wrap:normal 2、换行: word-break:break-all;word-wrap:break-word 以上的换行只支持英文,当标题中包含有中文时并不好用。 3、如果标题中含有中文的,只能在GridView的RowDataBound事件中添加代码,如下: if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[0].Text = "<nobr>操作用户</nobr>"; e.Row.Cells[1].Text = "<nobr>批次名称</nobr>"; e.Row.Cells[2].Text = "<nobr>文件名称</nobr>"; e.Row.Cells[3].Text = "<nobr>档案类型</nobr>"; e.Row.Cells[4].Text = "<nobr>字段名称</nobr>";
asp.net 标题不让换行
最新推荐文章于 2022-03-21 22:10:12 发布
本文介绍了一种解决ASP.NET GridView标题中包含中文时的换行问题的方法,通过在RowDataBound事件中添加代码实现标题内容的正确显示。
2251

被折叠的 条评论
为什么被折叠?



