Subversion-Projekte lars-tiefland.cienc

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
9 lars 1
<!DOCTYPE html>
2
<html>
3
<head>
4
	<meta charset="utf-8">
5
	<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
6
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
7
 
8
	<title>DataTables example - Multiple tables</title>
9
	<link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css">
10
	<link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
11
	<link rel="stylesheet" type="text/css" href="../resources/demo.css">
12
	<style type="text/css" class="init">
13
 
14
	div.dataTables_wrapper {
15
		margin-bottom: 3em;
16
	}
17
 
18
	</style>
19
	<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.11.3.min.js"></script>
20
	<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script>
21
	<script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script>
22
	<script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
23
	<script type="text/javascript" language="javascript" class="init">
24
 
25
$(document).ready(function() {
26
	$('table.display').DataTable();
27
} );
28
 
29
	</script>
30
</head>
31
 
32
<body class="dt-example">
33
	<div class="container">
34
		<section>
35
			<h1>DataTables example <span>Multiple tables</span></h1>
36
 
37
			<div class="info">
38
				<p>Often you might wish to initialise multiple tables with a single statement. This is trivially done by using a jQuery selector which will pick up multiple
39
				tables.</p>
40
 
41
				<p>The tables are independent for user control (i.e. user controlled paging on one table does not effect the others), but they do share the initialisation
42
				parameters given (for example if you specific the Spanish language file, all tables will be shown in Spanish). Additionally, the API can be used to manipulate both
43
				together, or independently.</p>
44
 
45
				<p>The example below shows two tables initialised with a single line of code, through the use of the <code>table.display</code> selector (i.e. select all elements
46
				which have the class of <code>table.display</code> (which is suitable in this example, you might wish to use a different selector).</p>
47
			</div>
48
 
49
			<table id="" class="display" cellspacing="0" width="100%">
50
				<thead>
51
					<tr>
52
						<th>Name</th>
53
						<th>Position</th>
54
						<th>Office</th>
55
						<th>Age</th>
56
						<th>Salary</th>
57
					</tr>
58
				</thead>
59
 
60
				<tfoot>
61
					<tr>
62
						<th>Name</th>
63
						<th>Position</th>
64
						<th>Office</th>
65
						<th>Age</th>
66
						<th>Salary</th>
67
					</tr>
68
				</tfoot>
69
 
70
				<tbody>
71
					<tr>
72
						<td>Tiger Nixon</td>
73
						<td>System Architect</td>
74
						<td>Edinburgh</td>
75
						<td>61</td>
76
						<td>$320,800</td>
77
					</tr>
78
					<tr>
79
						<td>Cedric Kelly</td>
80
						<td>Senior Javascript Developer</td>
81
						<td>Edinburgh</td>
82
						<td>22</td>
83
						<td>$433,060</td>
84
					</tr>
85
					<tr>
86
						<td>Sonya Frost</td>
87
						<td>Software Engineer</td>
88
						<td>Edinburgh</td>
89
						<td>23</td>
90
						<td>$103,600</td>
91
					</tr>
92
					<tr>
93
						<td>Quinn Flynn</td>
94
						<td>Support Lead</td>
95
						<td>Edinburgh</td>
96
						<td>22</td>
97
						<td>$342,000</td>
98
					</tr>
99
					<tr>
100
						<td>Dai Rios</td>
101
						<td>Personnel Lead</td>
102
						<td>Edinburgh</td>
103
						<td>35</td>
104
						<td>$217,500</td>
105
					</tr>
106
					<tr>
107
						<td>Gavin Joyce</td>
108
						<td>Developer</td>
109
						<td>Edinburgh</td>
110
						<td>42</td>
111
						<td>$92,575</td>
112
					</tr>
113
					<tr>
114
						<td>Martena Mccray</td>
115
						<td>Post-Sales support</td>
116
						<td>Edinburgh</td>
117
						<td>46</td>
118
						<td>$324,050</td>
119
					</tr>
120
					<tr>
121
						<td>Jennifer Acosta</td>
122
						<td>Junior Javascript Developer</td>
123
						<td>Edinburgh</td>
124
						<td>43</td>
125
						<td>$75,650</td>
126
					</tr>
127
					<tr>
128
						<td>Shad Decker</td>
129
						<td>Regional Director</td>
130
						<td>Edinburgh</td>
131
						<td>51</td>
132
						<td>$183,000</td>
133
					</tr>
134
				</tbody>
135
			</table>
136
 
137
			<table id="" class="display" cellspacing="0" width="100%">
138
				<thead>
139
					<tr>
140
						<th>Name</th>
141
						<th>Position</th>
142
						<th>Office</th>
143
						<th>Age</th>
144
						<th>Salary</th>
145
					</tr>
146
				</thead>
147
 
148
				<tfoot>
149
					<tr>
150
						<th>Name</th>
151
						<th>Position</th>
152
						<th>Office</th>
153
						<th>Age</th>
154
						<th>Salary</th>
155
					</tr>
156
				</tfoot>
157
 
158
				<tbody>
159
					<tr>
160
						<td>Jena Gaines</td>
161
						<td>Office Manager</td>
162
						<td>London</td>
163
						<td>30</td>
164
						<td>$90,560</td>
165
					</tr>
166
					<tr>
167
						<td>Haley Kennedy</td>
168
						<td>Senior Marketing Designer</td>
169
						<td>London</td>
170
						<td>43</td>
171
						<td>$313,500</td>
172
					</tr>
173
					<tr>
174
						<td>Tatyana Fitzpatrick</td>
175
						<td>Regional Director</td>
176
						<td>London</td>
177
						<td>19</td>
178
						<td>$385,750</td>
179
					</tr>
180
					<tr>
181
						<td>Michael Silva</td>
182
						<td>Marketing Designer</td>
183
						<td>London</td>
184
						<td>66</td>
185
						<td>$198,500</td>
186
					</tr>
187
					<tr>
188
						<td>Bradley Greer</td>
189
						<td>Software Engineer</td>
190
						<td>London</td>
191
						<td>41</td>
192
						<td>$132,000</td>
193
					</tr>
194
					<tr>
195
						<td>Angelica Ramos</td>
196
						<td>Chief Executive Officer (CEO)</td>
197
						<td>London</td>
198
						<td>47</td>
199
						<td>$1,200,000</td>
200
					</tr>
201
					<tr>
202
						<td>Suki Burks</td>
203
						<td>Developer</td>
204
						<td>London</td>
205
						<td>53</td>
206
						<td>$114,500</td>
207
					</tr>
208
					<tr>
209
						<td>Prescott Bartlett</td>
210
						<td>Technical Author</td>
211
						<td>London</td>
212
						<td>27</td>
213
						<td>$145,000</td>
214
					</tr>
215
					<tr>
216
						<td>Timothy Mooney</td>
217
						<td>Office Manager</td>
218
						<td>London</td>
219
						<td>37</td>
220
						<td>$136,200</td>
221
					</tr>
222
					<tr>
223
						<td>Bruno Nash</td>
224
						<td>Software Engineer</td>
225
						<td>London</td>
226
						<td>38</td>
227
						<td>$163,500</td>
228
					</tr>
229
					<tr>
230
						<td>Hermione Butler</td>
231
						<td>Regional Director</td>
232
						<td>London</td>
233
						<td>47</td>
234
						<td>$356,250</td>
235
					</tr>
236
					<tr>
237
						<td>Lael Greer</td>
238
						<td>Systems Administrator</td>
239
						<td>London</td>
240
						<td>21</td>
241
						<td>$103,500</td>
242
					</tr>
243
				</tbody>
244
			</table>
245
 
246
			<ul class="tabs">
247
				<li class="active">Javascript</li>
248
				<li>HTML</li>
249
				<li>CSS</li>
250
				<li>Ajax</li>
251
				<li>Server-side script</li>
252
			</ul>
253
 
254
			<div class="tabs">
255
				<div class="js">
256
					<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
257
	$('table.display').DataTable();
258
} );</code>
259
 
260
					<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
261
 
262
					<ul>
263
						<li><a href="//code.jquery.com/jquery-1.11.3.min.js">//code.jquery.com/jquery-1.11.3.min.js</a></li>
264
						<li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
265
					</ul>
266
				</div>
267
 
268
				<div class="table">
269
					<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
270
				</div>
271
 
272
				<div class="css">
273
					<div>
274
						<p>This example uses a little bit of additional CSS beyond what is loaded from the library files (below), in order to correctly display the table. The
275
						additional CSS used is shown below:</p><code class="multiline language-css">div.dataTables_wrapper {
276
		margin-bottom: 3em;
277
	}</code>
278
					</div>
279
 
280
					<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
281
 
282
					<ul>
283
						<li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li>
284
					</ul>
285
				</div>
286
 
287
				<div class="ajax">
288
					<p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is
289
					loaded.</p>
290
				</div>
291
 
292
				<div class="php">
293
					<p>The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side
294
					processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
295
					documentation</a>.</p>
296
				</div>
297
			</div>
298
		</section>
299
	</div>
300
 
301
	<section>
302
		<div class="footer">
303
			<div class="gradient"></div>
304
 
305
			<div class="liner">
306
				<h2>Other examples</h2>
307
 
308
				<div class="toc">
309
					<div class="toc-group">
310
						<h3><a href="./index.html">Basic initialisation</a></h3>
311
						<ul class="toc active">
312
							<li><a href="./zero_configuration.html">Zero configuration</a></li>
313
							<li><a href="./filter_only.html">Feature enable / disable</a></li>
314
							<li><a href="./table_sorting.html">Default ordering (sorting)</a></li>
315
							<li><a href="./multi_col_sort.html">Multi-column ordering</a></li>
316
							<li class="active"><a href="./multiple_tables.html">Multiple tables</a></li>
317
							<li><a href="./hidden_columns.html">Hidden columns</a></li>
318
							<li><a href="./complex_header.html">Complex headers (rowspan and colspan)</a></li>
319
							<li><a href="./dom.html">DOM positioning</a></li>
320
							<li><a href="./flexible_width.html">Flexible table width</a></li>
321
							<li><a href="./state_save.html">State saving</a></li>
322
							<li><a href="./alt_pagination.html">Alternative pagination</a></li>
323
							<li><a href="./scroll_y.html">Scroll - vertical</a></li>
324
							<li><a href="./scroll_y_dynamic.html">Scroll - vertical, dynamic height</a></li>
325
							<li><a href="./scroll_x.html">Scroll - horizontal</a></li>
326
							<li><a href="./scroll_xy.html">Scroll - horizontal and vertical</a></li>
327
							<li><a href="./comma-decimal.html">Language - Comma decimal place</a></li>
328
							<li><a href="./language.html">Language options</a></li>
329
						</ul>
330
					</div>
331
 
332
					<div class="toc-group">
333
						<h3><a href="../advanced_init/index.html">Advanced initialisation</a></h3>
334
						<ul class="toc">
335
							<li><a href="../advanced_init/events_live.html">DOM / jQuery events</a></li>
336
							<li><a href="../advanced_init/dt_events.html">DataTables events</a></li>
337
							<li><a href="../advanced_init/column_render.html">Column rendering</a></li>
338
							<li><a href="../advanced_init/length_menu.html">Page length options</a></li>
339
							<li><a href="../advanced_init/dom_multiple_elements.html">Multiple table control elements</a></li>
340
							<li><a href="../advanced_init/complex_header.html">Complex headers with column visibility</a></li>
341
							<li><a href="../advanced_init/object_dom_read.html">Read HTML to data objects</a></li>
342
							<li><a href="../advanced_init/html5-data-attributes.html">HTML5 data-* attributes - cell data</a></li>
343
							<li><a href="../advanced_init/html5-data-options.html">HTML5 data-* attributes - table options</a></li>
344
							<li><a href="../advanced_init/language_file.html">Language file</a></li>
345
							<li><a href="../advanced_init/defaults.html">Setting defaults</a></li>
346
							<li><a href="../advanced_init/row_callback.html">Row created callback</a></li>
347
							<li><a href="../advanced_init/row_grouping.html">Row grouping</a></li>
348
							<li><a href="../advanced_init/footer_callback.html">Footer callback</a></li>
349
							<li><a href="../advanced_init/dom_toolbar.html">Custom toolbar elements</a></li>
350
							<li><a href="../advanced_init/sort_direction_control.html">Order direction sequence control</a></li>
351
						</ul>
352
					</div>
353
 
354
					<div class="toc-group">
355
						<h3><a href="../styling/index.html">Styling</a></h3>
356
						<ul class="toc">
357
							<li><a href="../styling/display.html">Base style</a></li>
358
							<li><a href="../styling/no-classes.html">Base style - no styling classes</a></li>
359
							<li><a href="../styling/cell-border.html">Base style - cell borders</a></li>
360
							<li><a href="../styling/compact.html">Base style - compact</a></li>
361
							<li><a href="../styling/hover.html">Base style - hover</a></li>
362
							<li><a href="../styling/order-column.html">Base style - order-column</a></li>
363
							<li><a href="../styling/row-border.html">Base style - row borders</a></li>
364
							<li><a href="../styling/stripe.html">Base style - stripe</a></li>
365
							<li><a href="../styling/bootstrap.html">Bootstrap</a></li>
366
							<li><a href="../styling/foundation.html">Foundation</a></li>
367
							<li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a></li>
368
						</ul>
369
					</div>
370
 
371
					<div class="toc-group">
372
						<h3><a href="../data_sources/index.html">Data sources</a></h3>
373
						<ul class="toc">
374
							<li><a href="../data_sources/dom.html">HTML (DOM) sourced data</a></li>
375
							<li><a href="../data_sources/ajax.html">Ajax sourced data</a></li>
376
							<li><a href="../data_sources/js_array.html">Javascript sourced data</a></li>
377
							<li><a href="../data_sources/server_side.html">Server-side processing</a></li>
378
						</ul>
379
					</div>
380
 
381
					<div class="toc-group">
382
						<h3><a href="../api/index.html">API</a></h3>
383
						<ul class="toc">
384
							<li><a href="../api/add_row.html">Add rows</a></li>
385
							<li><a href="../api/multi_filter.html">Individual column searching (text inputs)</a></li>
386
							<li><a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a></li>
387
							<li><a href="../api/highlight.html">Highlighting rows and columns</a></li>
388
							<li><a href="../api/row_details.html">Child rows (show extra / detailed information)</a></li>
389
							<li><a href="../api/select_row.html">Row selection (multiple rows)</a></li>
390
							<li><a href="../api/select_single_row.html">Row selection and deletion (single row)</a></li>
391
							<li><a href="../api/form.html">Form inputs</a></li>
392
							<li><a href="../api/counter_columns.html">Index column</a></li>
393
							<li><a href="../api/show_hide.html">Show / hide columns dynamically</a></li>
394
							<li><a href="../api/api_in_init.html">Using API in callbacks</a></li>
395
							<li><a href="../api/tabs_and_scrolling.html">Scrolling and Bootstrap tabs</a></li>
396
							<li><a href="../api/regex.html">Search API (regular expressions)</a></li>
397
						</ul>
398
					</div>
399
 
400
					<div class="toc-group">
401
						<h3><a href="../ajax/index.html">Ajax</a></h3>
402
						<ul class="toc">
403
							<li><a href="../ajax/simple.html">Ajax data source (arrays)</a></li>
404
							<li><a href="../ajax/objects.html">Ajax data source (objects)</a></li>
405
							<li><a href="../ajax/deep.html">Nested object data (objects)</a></li>
406
							<li><a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a></li>
407
							<li><a href="../ajax/orthogonal-data.html">Orthogonal data</a></li>
408
							<li><a href="../ajax/null_data_source.html">Generated content for a column</a></li>
409
							<li><a href="../ajax/custom_data_property.html">Custom data source property</a></li>
410
							<li><a href="../ajax/custom_data_flat.html">Flat array data source</a></li>
411
							<li><a href="../ajax/defer_render.html">Deferred rendering for speed</a></li>
412
						</ul>
413
					</div>
414
 
415
					<div class="toc-group">
416
						<h3><a href="../server_side/index.html">Server-side</a></h3>
417
						<ul class="toc">
418
							<li><a href="../server_side/simple.html">Server-side processing</a></li>
419
							<li><a href="../server_side/custom_vars.html">Custom HTTP variables</a></li>
420
							<li><a href="../server_side/post.html">POST data</a></li>
421
							<li><a href="../server_side/ids.html">Automatic addition of row ID attributes</a></li>
422
							<li><a href="../server_side/object_data.html">Object data source</a></li>
423
							<li><a href="../server_side/row_details.html">Row details</a></li>
424
							<li><a href="../server_side/select_rows.html">Row selection</a></li>
425
							<li><a href="../server_side/jsonp.html">JSONP data source for remote domains</a></li>
426
							<li><a href="../server_side/defer_loading.html">Deferred loading of data</a></li>
427
							<li><a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a></li>
428
						</ul>
429
					</div>
430
 
431
					<div class="toc-group">
432
						<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
433
						<ul class="toc">
434
							<li><a href="../plug-ins/api.html">API plug-in methods</a></li>
435
							<li><a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a></li>
436
							<li><a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a></li>
437
							<li><a href="../plug-ins/range_filtering.html">Custom filtering - range search</a></li>
438
							<li><a href="../plug-ins/dom_sort.html">Live DOM ordering</a></li>
439
						</ul>
440
					</div>
441
				</div>
442
 
443
				<div class="epilogue">
444
					<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
445
					Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
446
					"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
447
 
448
					<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &#169; 2007-2015<br>
449
					DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
450
				</div>
451
			</div>
452
		</div>
453
	</section>
454
</body>
455
</html>