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