asp.net-mvc - 有什么办法可以让 table 变宽吗?也许 bootstrap 在某处设置了 max-witdh ?

标签 asp.net-mvc model-view-controller bootstrap-4

enter image description here

我找不到如何使该表更宽以便所有列都适合它,有什么想法吗?当它已经简单明了时,为什么我必须在这里添加更多细节?有时在这里添加一个简单的问题太困难了。

    <table class="table table-striped">
    <tr class="table-primary">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.legacyCode)
        </th>
        <th>
            Laboratorio
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Descripcion)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Excluida)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.sMercado)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Orden)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.legacyCode)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Laboratorio.Descripcion)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Descripcion)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Excluida)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.sMercado)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Orden)
            </td>
            <td>
                <a href='@Url.Action("Edit", "LineaDeProductos", new { id=item.ID })' class="btn btnModificar btn-sm">Modificar</a>
                <a href='@Url.Action("Details", "LineaDeProductos", new { id=item.ID })' class="btn btnDetalles btn-sm">Detalle</a>
                <a href='@Url.Action("Delete", "LineaDeProductos", new { id=item.ID })' class="btn btnEliminar btn-sm">Eliminar</a>
            </td>
        </tr>
    }
</table>

尝试链接:Example Table

最佳答案

更改您的父容器以使用container-fluid:

<div class="container-fluid">
  <table class="table table-striped">

确保父容器是最顶层的容器。

关于asp.net-mvc - 有什么办法可以让 table 变宽吗?也许 bootstrap 在某处设置了 max-witdh ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54808546/

相关文章:

asp.net-mvc - 将对象列表绑定(bind)到表单

wpf mvvm混淆

javascript - 本地 Bootstrap 、css、js 文件不起作用

html - Bootstrap 4 : Vertically center badge with utilities only

html - Bootstrap 功能列表布局

javascript - 将数据从 mvc Controller 传递到 Angular Controller 和范围

javascript - 如何向动态添加的控件添加唯一的ID(Asp.net MVC)

c# - 如何在 ASP.NET MVC 5 Controller 中返回 http 中的字符串?

c# - 使用 ViewModel 从多个表中获取数据?

java - 从Java中的单独类文件调用方法