Wrap lines in table cells ASP.NET MVC C #

0

How do I not break the columns of a <table> in several lines, because I put a scroll and would like to leave the grid cells without breaking, but let the user use the scroll.

  

ViewTable

@modelIEnumerable<Projeto.ERP.Model.Model.Cadastros.Pessoas.PessoaModel>@usingPagedList.Mvc;@usingPagedList;@{ViewBag.Title="GridViewMvc";
}

<h2>GridViewMvc</h2>

<div style="overflow: auto; width: 1140px">
    <table class="table table-striped table-bordered table-responsive table-hover">
        <thead>
            <tr>
                <th>
                    @Html.DisplayNameFor(model => model.Descricao)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.CPF)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.RG)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Logradouro)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Numero)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Complemento)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Bairro)
                </th>
                <th>
                    @Html.DisplayName("País")
                </th>
                <th>
                    @Html.DisplayName("Estado")
                </th>
                <th>
                    @Html.DisplayName("Cidade")
                </th>
                <th>
                    @Html.DisplayName("País")
                </th>
                <th>
                    @Html.DisplayName("Estado")
                </th>
                <th>
                    @Html.DisplayName("Cidade")
                </th>
            </tr>
        </thead>
        <tbody>

            @foreach (var registro in Model.ToList())
            {
            <th>
                @registro.Descricao
            </th>
            <th>
                @registro.CPF
            </th>
            <th>
                @registro.RG
            </th>
            <th>
                @registro.Logradouro
            </th>
            <th>
                @registro.Numero
            </th>
            <th>
                @registro.Complemento
            </th>
            <th>
                @registro.Bairro
            </th>
            <th>
                @registro.Pais.Descricao
            </th>
            <th>
                @registro.Estado.Descricao
            </th>
            <th>
                @registro.Cidade.Descricao
            </th>
            <th>
                @registro.Pais.Descricao
            </th>
            <th>
                @registro.Estado.Descricao
            </th>
            <th>
                @registro.Cidade.Descricao
            </th>
            }

            </tbody>
        </table>
        @if (ViewBag.PageCount > 1)
        {
            <div class="row">
                <div class="offset1 span10 font-small">
                    Pag: @(ViewBag.PageCount < ViewBag.PageNumber ? 0 : ViewBag.PageNumber) de @ViewBag.PageCount
                    @Html.PagedListPager((IPagedList)Model, page => Url.Action("Index", new { page, sortOrder = ViewBag.CurrentSort, searchString = ViewBag.CurrentSearch }))
                </div>
            </div>
        }

    </div>
    
asked by anonymous 10.10.2017 / 18:43

1 answer

0

You can do this using CSS

table{
    white-space: nowrap;
}
    
10.10.2017 / 19:55