DataTables-Very powerful jQuery form plugin, variable width page view, live filter.
Multi-column sorting, automatic probing of data types, smart column widths, and data acquisition from almost any data source.
So how to use the DataTables under bootstrap:
Just use the HTML or EJS to refer to the written stylesheet CSS and script file js, the corresponding code is as follows:
1 <Head>2 <Linkhref= "Http://apps.bdimg.com/libs/bootstrap/3.0.3/css/bootstrap.min.css"rel= "stylesheet">3 <Scriptsrc= "Http://apps.bdimg.com/libs/jquery/2.0.0/jquery.min.js"></Script>4 <Scriptsrc= "Http://apps.bdimg.com/libs/bootstrap/3.0.3/js/bootstrap.min.js"></Script>5 <Linkrel= "stylesheet"href= "Http://cdn.datatables.net/1.10.4/css/jquery.dataTables.css"></style>6 <Scriptsrc= "Http://cdn.datatables.net/1.10.4/js/jquery.dataTables.js"></Script> 7 <Scriptsrc= "Http://cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js"></Script> 8 <Script>9 $ (document). Ready (function(){Ten $('#example'). dataTable (); One }); A </Script> - <MetaCharSet=utf-8 "> - <title><%=title%></title> the </Head> - <Body> - <Divclass= "Table-responsive"> - <TableID= "Example"class= "Display table table-bordered table-striped table-hover"width= "100%">
The 5th line is to establish the relationship with the external resource jquery DataTables;
6th, Line 7 is the script file that loads jquery separately datatables.js and dataTables.min.js
Line 8-11 reads table from jquery and displays the results on the page.
The mistake I made in this process was in line 5th, and I wrote link as a 6,7 script, which didn't get the result I wanted,
Later, the difference between link and script was realized by querying the data:
<link> tags define the relationship between documents and external resources <link> tags are often used to link to style sheets;
<style> tags define the HTML document's style file reference address <style> element you need to specify a style file to render the HTML document.
In this way it is impossible to get the desired style without creating a style sheet.
jquery DataTables Table Plug-in Usage (Web page data table and pagination display)