我有一个带表格的 Razor 页面。 在我申请之前一切看起来都很好 jquery bootgrid . 列宽固定,数据被截断。 列宽固定,数据被截断。
如何将列宽保持为自动以便数据不被截断? 如何将列宽保持为自动以便数据不被截断?
<table id="grid" class="table table-condensed table-hover table-striped">
<thead>
<tr>
<th data-column-id="Nominal">
Nominal
</th>
<th data-column-id="TD">
Tradedate / Valuedate
</th>
<th data-column-id="ReleaseDate">
ReleaseDate
</th>
<th data-column-id="Fund">
Fund
</th>
<th data-column-id="Pre-Pay">
Pre-Pay
</th>
<th data-column-id="Comment">
Comment
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Nominal)
</td>
<td>
@Html.DisplayFor(modelItem => item.TD) <br />
@Html.DisplayFor(modelItem => item.VD)
</td>
<td>
@Html.DisplayFor(modelItem => item.ReleaseDate)
</td>
<td>
@Html.DisplayFor(modelItem => item.Fund)
</td>
<td>
@Html.DisplayFor(modelItem => item.Pre_Pay)
</td>
<td>
@Html.DisplayFor(modelItem => item.Comment)
</td>
</tr>
}
</tbody>
</table>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
$("#grid").bootgrid({
caseSensitive: false
})
});
</script>
最佳答案
已解决:style = "table-layout: auto;"
是我需要的。
关于jQuery bootgrid 插件——设置列宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53884519/