当前位置: 代码迷 >> 综合 >> bootstrap table 文本溢出鼠标悬浮提示完整内容
  详细解决方案

bootstrap table 文本溢出鼠标悬浮提示完整内容

热度:43   发布时间:2024-02-23 10:04:54.0
1.添加样式,文本溢出省略显示
table{width:120px;table-layout:fixed;/* 只有定义了表格的布局算法为fixed,下面td的定义才能起作用。 */
}
td{width:100%;word-break:keep-all;/* 不换行 */white-space:nowrap;/* 不换行 */overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用*/-o-text-overflow:ellipsis;-icab-text-overflow: ellipsis;-khtml-text-overflow: ellipsis;-moz-text-overflow: ellipsis;-webkit-text-overflow: ellipsis;
}
2.鼠标悬浮,提示完整文本内容
onLoadSuccess: function () {$('.bootstrap-table tr td').each(function () {$(this).attr("title", $(this).text());$(this).css("cursor", 'pointer');});},
  相关解决方案