DataTables multiple tables example

# Preamble

Using standard jQuery selector syntax with DataTables it is trivial to initialise multiple tables with a single line of Javascript, as shown below. All tables are completely independent, but share the parameters passed thought the initialiser object (for example if you specific the Spanish language file, all tables will be shown in Spanish).

# Live example

Trident based browsers

Browser | Platform(s) | Engine version | CSS grade
--- | --- | --- | ---
Internet Explorer 4.0 | Win 95+ | 4 | X
Internet Explorer 5.0 | Win 95+ | 5 | C
Internet Explorer 5.5 | Win 95+ | 5.5 | A
Internet Explorer 6 | Win 98+ | 6 | A
Internet Explorer 7 | Win XP SP2+ | 7 | A
AOL browser (AOL desktop) | Win XP | 6 | A

Gecko based browsers

Browser | Platform(s) | Engine version | CSS grade
--- | --- | --- | ---
Firefox 1.0 | Win 98+ / OSX.2+ | 1.7 | A
Firefox 1.5 | Win 98+ / OSX.2+ | 1.8 | A
Firefox 2.0 | Win 98+ / OSX.2+ | 1.8 | A
Firefox 3.0 | Win 2k+ / OSX.3+ | 1.9 | A
Camino 1.0 | OSX.2+ | 1.8 | A
Camino 1.5 | OSX.3+ | 1.8 | A
Netscape 7.2 | Win 95+ / Mac OS 8.6-9.2 | 1.7 | A
Netscape Browser 8 | Win 98SE+ | 1.7 | A
Netscape Navigator 9 | Win 98+ / OSX.2+ | 1.8 | A
Mozilla 1.0 | Win 95+ / OSX.1+ | 1 | A
Mozilla 1.1 | Win 95+ / OSX.1+ | 1.1 | A
Mozilla 1.2 | Win 95+ / OSX.1+ | 1.2 | A
Mozilla 1.3 | Win 95+ / OSX.1+ | 1.3 | A
Mozilla 1.4 | Win 95+ / OSX.1+ | 1.4 | A
Mozilla 1.5 | Win 95+ / OSX.1+ | 1.5 | A
Mozilla 1.6 | Win 95+ / OSX.1+ | 1.6 | A
Mozilla 1.7 | Win 98+ / OSX.1+ | 1.7 | A
Mozilla 1.8 | Win 98+ / OSX.1+ | 1.8 | A
Seamonkey 1.1 | Win 98+ / OSX.2+ | 1.8 | A
Epiphany 2.20 | Gnome | 1.8 | A

WebKit based browsers (note no platform)

Browser | Engine version | CSS grade
--- | --- | ---
Safari 1.2 | 125.5 | A
Safari 1.3 | 312.8 | A
Safari 2.0 | 419.3 | A
Safari 3.0 | 522.1 | A
OmniWeb 5.5 | 420 | A
iPod Touch / iPhone | 420.1 | A
S60 | 413 | A

# Initialisation code

    $(document).ready(function() {
    	$('.dataTable').dataTable();
    } );

# Other examples

## Basic initialisation

- Zero configuration
- Feature enablement
- Sorting data
- Multi-column sorting
- Multiple tables
- Hidden columns
- Complex headers - grouping with colspan
- DOM positioning
- Flexible table width
- State saving
- Alternative pagination styles
- Scrolling:
  Horizontal / Vertical / Both / Themed / Infinite
- Change language information (internationalisation)
- ThemeRoller themes (Smoothness)

## Advanced initialisation

- Events:
  Live events / Pre-init / Post-init
- Column rendering
- Sorting without HTML tags
- Multiple table controls (sDom)
- Defining length menu options
- Complex headers and hidden columns
- Custom toolbar (element) around table
- Row highlighting with CSS
- Row grouping
- Row callback
- Footer callback
- Control sorting direction of columns
- Change language information from a file (internationalisation)
- Setting defaults
- State saving with localStorage
- Custom events

## API

- Dynamically add a new row
- Individual column filtering (using "input" elements)
- Individual column filtering (using "select" elements)
- Highlight rows and columns
- Show and hide details about a particular record
- User selectable rows (multiple rows)
- User selectable rows (single row) and delete rows
- Editable rows (with jEditable)
- Submit form with elements in table
- Index column (static number column)
- Show and hide columns dynamically
- API function use in initialisation object (callback)
- DataTables scrolling and tabs
- Regular expression filtering

## Data sources

- DOM
- Javascript array
- Ajax source
- Server side processing

## Server-side processing

- Obtain server-side data
- Add extra HTTP variables
- Use HTTP POST
- Automatic addition of IDs and classes to rows
- Reading table data from objects
- Show and hide details about a particular record
- User selectable rows (multiple rows)
- JSONP for a cross domain data source
- jEditable integration with DataTables
- Deferred loading of Ajax data
- Pipelining data (reduce Ajax calls for paging)

## Ajax data source

- Ajax sourced data (array of arrays)
- Ajax sourced data (array of objects)
- Deferred DOM creation for extra speed
- Empty data source columns
- Use a data source other than aaData (the default)
- Read column data from sub-arrays
- Read column data from deeply nested properties

## Plug-ins

- Add custom API functions
- Sorting and automatic type detection
- Sorting without automatic type detection
- Custom pagination controls
- Range filtering / custom filtering
- Live DOM sorting
- Automatic HTML type detection