[HTML表格]在databases顯示行的附加資訊,databases附加資訊

來源:互聯網
上載者:User

[HTML表格]在databases顯示行的附加資訊,databases附加資訊

模板代碼:

<!-- DataTables CSS -->    <link rel="stylesheet" href="{% static 'DataTables/css/jquery.dataTables.css' %}">    <!-- jquery -->    <script src="{% static 'js/jquery/jquery.min.js' %}"></script>    <!-- DataTables -->    <script src="{% static 'DataTables/js/jquery.dataTables.js' %}"></script>    <script>    function format () {    return '<table cellpadding="5" cellspacing="0" border="0">'+        '<tr>'+            '<td>Full name:</td>'+        '</tr>'+        '<tr>'+            '<td>Extension number:</td>'+        '</tr>'+        '<tr>'+            '<td>Extra info:</td>'+            '<td>And any further details here (images etc)...</td>'+        '</tr>'+    '</table>';    }    $(document).ready(function(){         var table = $('#t1').DataTable({              language: {//國際化              "sProcessing": "處理中...",              "sLengthMenu": "顯示 _MENU_ 項結果",              "sZeroRecords": "沒有匹配結果",              "sInfo": "顯示第 _START_ 至 _END_ 項結果,共 _TOTAL_ 項",              "sInfoEmpty": "顯示第 0 至 0 項結果,共 0 項",              "sInfoFiltered": "(由 _MAX_ 項結果過濾)",              "sInfoPostFix": "",              "sSearch": "搜尋:",              "sUrl": "",              "sEmptyTable": "表中資料為空白",              "sLoadingRecords": "載入中...",              "sInfoThousands": ",",              "oPaginate": {                  "sFirst": "首頁",                  "sPrevious": "上頁",                  "sNext": "下頁",                  "sLast": "末頁"              },              "oAria": {                  "sSortAscending": ": 以升序排列此列",                  "sSortDescending": ": 以降序排列此列"              }          }            });    $('#t1_body').on('click', 'td.test', function () {            var tr = $(this).closest('tr');        var row = table.row( tr );        if ( row.child.isShown() ) {            // This row is already open - close it            row.child.hide();            tr.removeClass('shown');        }        else {            // Open this row            row.child( format()).show();            tr.addClass('shown');        }    }); })    </script></head><body>                                     <table border="1" id="t1">                            <thead id="t1_head">                                <tr>                            <th>合約編碼</th><th>合約名稱</th><th>客戶名稱</th><th>簽訂日期</th><th>生效時間</th><th>失效時間</th><th>狀態</th><th>年限</th><th>類型</th><th>經辦人</th><th>新增/續簽</th><th>原合約編碼</th><th>傭金髮放</th>                          </tr>                            </thead>                             <tbody id="t1_body">                                 {% for data in bill_data %}                                 <tr>                                   <td class="test">{{ data.contract_code }}</td>                                   <td>{{ data.contract_name }}</td>                                   <td>{{ data.cust_name }}</td>                                   <td>{{ data.con_sign_date }}</td>                                   <td>{{ data.con_eff_date }}</td>                                   <td>{{ data.con_exp_date }}</td>                                   <td>{{ data.con_state }}</td>                                   <td>{{ data.con_age }}</td>                                   <td>{{ data.con_type }}</td>                                   <td>{{ data.con_agent }}</td>                                   <td>{{ data.new_flag }}</td>                                   <td>{{ data.original_code }}</td>                                   <td>{{ data.payment }}</td>                                  </tr>                                 {% endfor %}                             </tbody>                             <tfoot id="t1_foot">                                                          </tfoot>                       </table>

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.