1. 程式人生 > >bootstrap 表格設定列固定寬度以及內容自動換行的CSS

bootstrap 表格設定列固定寬度以及內容自動換行的CSS

<style type="text/css">
	#contentTable{
		table-layout:fixed; /* bootstrap-table設定colmuns中某列的寬度無效時,需要給整個表設定css屬性 */
		word-break:break-all; word-wrap:break-all; /* 自動換行 */
	}
</style>

<table id="contentTable" class="table table-striped table-bordered table-condensed ">
	<thead>
		<tr>
			<th style="width:314px;">訊息標題</th>
			<th style="width:80px;">策略名稱</th>
			<th style="width:160px;">重發訊息標題</th>
			<th style="width:80px;">訊息通道</th>
			<th style="width:160px;">訊息接收人</th>
		</tr>
	</thead>
	<tbody>
	</tbody>
</table>