亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

我使用 DataTables 的表不會折疊列

我使用 DataTables 的表不會折疊列

C#
青春有我 2022-01-15 16:56:08
我真的是新的工作數據表DataTables,我的表有問題我試圖讓列倒塌,但我沒有運氣,有人能告訴我我做錯了什么嗎?頂部的桌子由于某種原因沒有塌陷這是我的代碼<div class="col-md-12 col-sm-12 col-xs-12"><div class="x_title">    <h4>Title</h4>    <div class="clearfix"></div></div><div class="x_content">    <div id="datatable-responsive_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">        <div class="row">            <div class="col-sm-12 table-responsive">                <table id="datatable" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" role="grid" aria-describedby="datatable-responsive_info" style="width:100%">                    <thead>                        <tr>                            <th data-priority>@Html.DisplayNameFor(model => model.pagoEmitido.Folio)</th>                            <th data-priority>@Html.DisplayNameFor(model => model.pagoEmitido.Fecha)</th>                            <th data-priority="1">@Html.DisplayNameFor(model => model.pagoEmitido.cfdiFormaPagoClve)</th>                            <th data-priority="2">@Html.DisplayNameFor(model => model.pagoEmitido.Referencia)</th>                            <th data-priority>@Html.DisplayNameFor(model => model.pagoEmitido.Importe)</th>                        </tr>                    </thead>
查看完整描述

2 回答

?
狐的傳說

TA貢獻1804條經驗 獲得超3個贊

table-condensedbootstrap 中的類有助于做你想做的事。這是一個引導類。


查看完整回答
反對 回復 2022-01-15
?
慕的地8271018

TA貢獻1796條經驗 獲得超4個贊

解決方法很簡單,給我的表加個名字加類,表壓縮加JS


<div class="col-md-12 col-sm-12 col-xs-12">

<div class="x_title">

    <h4>Pagos Registrados</h4>


    <div class="clearfix"></div>

</div>

<div class="x_content">

    <div id="datatable-responsive_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">

        <div class="row">

            <div class="col-sm-12 table-responsive">

                <table id="tblaListaPagos" class="table display responsive table-responsive table-condensed table-striped  table-bordered dt-responsive nowrap" cellspacing="0" role="grid" aria-describedby="datatable-responsive_info" style="width:100%">

                    <thead>

                        <tr>

                            <th data-priority class="all">@Html.DisplayNameFor(model => model.pagoEmitido.Folio)</th>

                            <th data-priority class="all">@Html.DisplayNameFor(model => model.pagoEmitido.Fecha)</th>

                            <th data-priority="1">@Html.DisplayNameFor(model => model.pagoEmitido.cfdiFormaPagoClve)</th>

                            <th data-priority="2">@Html.DisplayNameFor(model => model.pagoEmitido.Referencia)</th>

                            <th data-priority class="all">@Html.DisplayNameFor(model => model.pagoEmitido.Importe)</th>

                        </tr>

                    </thead>

                    <tbody>

                        @if (Model.Count() > 0)

                        {

                            foreach (var item in Model)

                            {

                                <tr>

                                    <td>@Html.ActionLink("Pago " + item.pagoEmitido.Folio, "Details", "PagoEmitido", new { id = item.pagoEmitido.IdPagoEmitido }, null)</td>

                                    <td>@item.pagoEmitido.Fecha.ToShortDateString() </td>


                                    @if (!string.IsNullOrWhiteSpace(item.pagoEmitido.cfdiFormaPagoClve))

                                    {

                                        <td>@Html.DisplayFor(modelItem => item.pagoEmitido.cfdiFormaPagoClve) - @Html.DisplayFor(modelItem => item.pagoEmitido.cfdiFormaPagoDescripcion)</td>

                                    }

                                    else

                                    {

                                        <td>

                                            @Html.DisplayFor(modelItem => item.DescripcionTipoMetodPago)

                                        </td>

                                    }

                                    <td>@Html.DisplayFor(modelItem => item.pagoEmitido.Referencia)</td>

                                    <td>

                                        <span>@(MoneyFormatHelper.Format(item.pagoEmitido.Importe, item.pagoEmitido.Tenant.Decimales) + " (" + item.pagoEmitido.MonedaISO + ")")</span>

                                        @if (item.pagoEmitido.MonedaIsoOriginal != null && item.pagoEmitido.MonedaIsoOriginal != item.pagoEmitido.MonedaISO)

                                        {<br />

                                            <span style="font-size:10px">

                                                (@( MoneyFormatHelper.Format(item.pagoEmitido.ImporteOriginal.Value, item.pagoEmitido.Tenant.Decimales)

                                                                                                             + " " + item.pagoEmitido.MonedaIsoOriginal + " @ " + item.pagoEmitido.TipoCambio))

                                            </span>

                                        }

                                    </td>

                                </tr>

                            }

                        }

                    </tbody>

                </table>

            </div>

        </div>

    </div>

</div>

這里是我的 Js


$(function () {

    $('#tblaListaPagos').DataTable({

        responsive: true,

        searching: false,

        paging: false,

        info: false

    });

});

我希望它為別人服務。


查看完整回答
反對 回復 2022-01-15
  • 2 回答
  • 0 關注
  • 321 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號