DataTables Getting Started with

Source: Internet
Author: User

Brief introduction of preface

DataTables is a JavaScript class library that operates on HTML tables, changes table CSS styles, and enhances the functionality of the table to make it more interactive.

DataTables relies on the jquery class library.

Getting Started example

Environment: DataTables 1.10.11, JQuery 2.2.1

Getting Started code:

<!DOCTYPE HTML><HTML>    <Head>        <MetaCharSet= "Utf-8" />        <title>DataTable Learning</title>        <Linkrel= "stylesheet"type= "Text/css"href= "//" />    </Head>    <Body>        <TableID= "table_id"class= "Display">            <thead>                <TR>                    <th>Column 1</th>                    <th>Column 2</th>                </TR>            </thead>            <tbody>                <TR>                    <TD>Row 1 Data 1</TD>                    <TD>Row 1 Data 2</TD>                </TR>                <TR>                    <TD>Row 2 Data 1</TD>                    <TD>Row 2 Data 2</TD>                </TR>            </tbody>        </Table>        <!--jquery.js to be introduced before Jquery.dataTables.min.js -        <Scriptsrc= "//"type= "Text/javascript"></Script>        <Scriptsrc= "//"type= "Text/javascript"></Script>        <Scripttype= "Text/javascript">            $(function() {                $('#table_id').            DataTable (); })        </Script>    </Body></HTML>
key points of use

1, first introduce dataTables necessary documents: Jquery.dataTables.min.css and Jquery.dataTables.min.js

2. Because the DataTable relies on jquery, before introducing the DataTables JS file, you should also introduce the jquery file first: jquery.js

3, define the ordinary HTML table: <table id= "table_id" >...</table>

4. Initialize table with DataTable: $ (' #table_id '). DataTable ();

5. The example table has a style: class= "display", which is the style in the DataTables CSS file.

DataTables Getting Started with

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

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.