-
Book Overview & Buying
-
Table Of Contents
jQuery 1.3 with PHP
By :
Setting up DataTables involves setting up a table so that it has distinct <thead> and <tbody> sections, and then simply running dataTable() on it.
As a reminder, tables in HTML have a header and a body. The HTML elements <thead> and <tbody> are optional according to the specifications, but the DataTables plugin requires that you put them in, so that it knows what to work with.
These elements may not be familiar to you, as they are usually not necessary when you are writing your web pages and most people leave them out, but DataTables needs to know what area of the table to turn into a navigation bar, and which area will contain the data, so you need to include them.
The first example in this chapter is purely a client-side one. We will provide the data in the same page that is demonstrating the table.
Copy the following code into a file in a new demo directory and name it tables.html:
<html>
<head>
<script src...
Change the font size
Change margin width
Change background colour