一.在td的长度范围内要显示大量内容时,为了不破坏布局,只能显示该长度的文字,超过的的文字隐藏。 1.table 表中一定要设置 style="table-layout: fixed;" <table id="contentTable" class="table table-striped table-bordered table-condensed" style="table-layout: fixed;">
2.在td 中设置:style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis"
<td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis" οnmοusemοve="removeClassType(this)">
3.鼠标进入悬浮显示,其实就是将内容赋值给标题属性。
onmousemove:鼠标进入事件
<td style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis" οnmοusemοve="removeClassType(this)">
js:将td内的内容赋值给 title:标题内容
function removeClassType($this) { $($this).attr("title",$this.innerText); }