.table th, .table td { text-align: center; vertical-align: middle !important; } table { width: 100px; 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; } .table { table-layout: fixed; }
onLoadSuccess: function () { $('.bootstrap-table tr td').each(function () { $(this).attr("title", $(this).text()); $(this).css("cursor", 'pointer'); }); }