jQuery bootgrid 插件——设置列宽

标签 jquery html css jquery-bootgrid

我有一个带表格的 Razor 页面。 enter image description here 在我申请之前一切看起来都很好 jquery bootgrid . 列宽固定,数据被截断。 列宽固定,数据被截断。

如何将列宽保持为自动以便数据不被截断? 如何将列宽保持为自动以便数据不被截断?

enter image description here

  <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/

相关文章:

jquery - Javascript/jQuery 动画到动态高度?

javascript - jQuery 不适用于动态生成的 div

html - 网页中的对齐问题 - 响应式 CSS

html - 古怪的导航定位问题让我很困惑。

javascript - 即使页面发生变化,在点击时也显示 AJAX 请求?

javascript - 为什么第一个 DOM 操作比其他操作要长得多?

html - 旋转木马图像不在 bootstrap css 中旋转

javascript - 在html中动态嵌入视频

jquery - 如何使用两个...功能?在 jQuery 中通过两个 DIV 显示 DIV

html - 自定义字体不起作用