【发布时间】:2018-12-21 12:04:38
【问题描述】:
我有一个带有表格的 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>
【问题讨论】:
-
请发布复制您的问题的代码。否则我们无法为您提供帮助。请发布复制您的问题的代码。否则我们无法为您提供帮助。
-
这是整个代码。应用 bootgrid 列后缩小
-
如果我将此代码复制/粘贴到 sn-p 中,它不会复制您的情况。请制作一个复制您的问题的stackoverflow代码sn-p
标签: jquery html css jquery-bootgrid