zoukankan      html  css  js  c++  java
  • DataTabless Add rows

    参考官网案例:https://datatables.net/examples/api/add_row.html

    JS:

    $(document).ready(function() {

        var t = $('#example').DataTable();
        var counter = 1;
     
        $('#addRow').on( 'click'function () {
            t.row.add( [
                counter +'.1',
                counter +'.2',
                counter +'.3',
                counter +'.4',
                counter +'.5'
            ] ).draw( false );
     
            counter++;
        } );
     
        // Automatically add a first row of data
        $('#addRow').click();
     
    HTML:
     
    <table id="example" class="display" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th>Column 1</th>
                    <th>Column 2</th>
                    <th>Column 3</th>
                    <th>Column 4</th>
                    <th>Column 5</th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <th>Column 1</th>
                    <th>Column 2</th>
                    <th>Column 3</th>
                    <th>Column 4</th>
                    <th>Column 5</th>
                </tr>
            </tfoot>
        </table>
     
     
    CSS:
     
  • 相关阅读:
    希尔排序
    折半插入排序
    自学git心得-2
    读书笔记-1 《人月神话》
    USTCCourseCommunity 项目介绍
    自学git心得-1
    HDU 2006 求奇数的乘积
    HDU 2007 平方和与立方和
    HDU 2005 第几天?
    HDU 2004 成绩转换
  • 原文地址:https://www.cnblogs.com/sdream/p/5368267.html
Copyright © 2011-2022 走看看