我正在使用bootstap css表。我需要一個固定的長度表,其中表格中的內容(即..,td)應該包裝成多行,如果需要的話。td中固定長度和內容變形的引導表
下面是我的代碼不工作的片段。 td的內容不包含在固定長度的單元格內。
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<h2>Basic Table</h2>
<p>The .table class adds basic styling (light padding and only horizontal dividers) to a table:</p>
<div class="table-responsive">
<table class="table fixed">
<thead>
<tr>
<th class="col-xs-3">Firstname</th>
<th class="col-xs-3">Lastname</th>
<th class="col-xs-3">Email</th>
</tr>
</thead>
<tbody>
<tr>
<td class="col-xs-3">Johddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddn</td>
<td class="col-xs-3">Doe</td>
<td class="col-xs-3">[email protected]</td>
</tr>
<tr>
<td class="col-xs-3">Mary</td>
<td class="col-xs-3">Moe</td>
<td class="col-xs-3">[email protected]</td>
</tr>
<tr>
<td class="col-xs-3">July</td>
<td class="col-xs-3">Dooley</td>
<td >[email protected]</td>
</tr>
</tbody>
</table>
</div>
</div>
輸出I如在圖像。該單元格的內容溢出。在TD
word-wrap: break-word;
這工作就像魅力。謝謝! –