1个回答
展开全部
在页面加入属性:style =" word-break :break-all ; word-wrap:break-word " (table或div 等的属性里)
或设置
protected void GridView1_DataRowBound(object o, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//设置要换行的模板列
e.Row.Cells[0].Attributes.Add("style", "word-break :break-all ; word-wrap:break-word");
e.Row.Cells[1].Attributes.Add("style", "word-break :break-all ; word-wrap:break-word");
}
}
或设置
protected void GridView1_DataRowBound(object o, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//设置要换行的模板列
e.Row.Cells[0].Attributes.Add("style", "word-break :break-all ; word-wrap:break-word");
e.Row.Cells[1].Attributes.Add("style", "word-break :break-all ; word-wrap:break-word");
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询