layui表格自动换行相关css和js

<style>
	.layui-table-cell {
		height: auto;
		overflow: visible;
		text-overflow: inherit;
		white-space: normal;
		word-break: break-all;
	}

	.layui-table-cell a {
		text-decoration: underline;
	}

	.layui-table-cell div {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		min-height: 30px;
		line-height: 30px;
	}
</style>
<script>
	function nl2br(str, is_xhtml) {
		var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />' : '<br>';
		return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
	}
</script>

posted on 2022-09-08 11:39  小馬過河﹎  阅读(427)  评论(0)    收藏  举报

导航