xxxxxxxxxx
1
2
<div class="container mt-5 text-center">
3
<hr class="mt-5">
4
5
<p>Built with <a target="_blank" href="https://mdbootstrap.com/docs/standard/">Material Design for Bootstrap</a> - free and powerful Bootstrap UI KIT</p>
6
7
<a class="btn btn-primary me-2" href="https://mdbootstrap.com/docs/standard/getting-started/installation/" target="_blank" role="button">Download MDB UI KIT <i class="fas fa-download ms-2"></i></a>
8
<a class="btn btn-danger me-2" target="_blank" href="https://mdbootstrap.com/docs/standard/" role="button">Learn more</a>
9
<a class="btn btn-success me-2" target="_blank" href="https://mdbootstrap.com/docs/standard/getting-started/" role="button">Tutorials</a>
10
<a class="btn btn-dark me-2" target="_blank" href="https://github.com/mdbootstrap/mdb-ui-kit" role="button">GitHub <i class="fab fa-github ms-2"></i></a>
11
12
<hr class="mb-5">
13
</div>
14
15
<table id="dtBasicExample" class="table table-striped table-bordered" cellspacing="0" width="100%">
16
<thead>
17
<tr>
18
<th>Name</th>
19
<th>Position</th>
20
<th>Office</th>
21
<th>Age</th>
22
<th>Start date</th>
23
<th>Salary</th>
24
</tr>
25
</thead>
26
<tfoot>
27
<tr>
28
<th>Name</th>
29
<th>Position</th>
30
<th>Office</th>
31
<th>Age</th>
32
<th>Start date</th>
33
<th>Salary</th>
34
</tr>
35
</tfoot>
36
</table>
xxxxxxxxxx
1
2
3
/*
4
This is basic example of AJAX with MDB DataTable
5
On left - basic HTML structure
6
On right - JS initiate code with ajax
7
and JSON data
8
9
If you want to work with your project you need
10
to initiate DataTable.js and DataTable.css
11
available in MDB FREE and MDB PRO at folder addons
12
*/
xxxxxxxxxx
1
// Initiate code
2
$(document).ready(function () {
3
$('#dtBasicExample').DataTable({
4
"ajax": 'example.json'
5
});
6
$('.dataTables_length').addClass('bs-select');
7
});
8
9
10
// Below JSON DATA for JSON file to copy and paste
11
12
{
13
"data": [
14
[
15
"Tiger Nixon",
16
"System Architect",
17
"Edinburgh",
18
"5421",
19
"2011/04/25",
20
"$320,800"
21
],
22
[
23
"Garrett Winters",
24
"Accountant",
25
"Tokyo",
26
"8422",
27
"2011/07/25",
28
"$170,750"
29
],
30
[
31
"Ashton Cox",
32
"Junior Technical Author",
33
"San Francisco",
34
"1562",
35
"2009/01/12",
36
"$86,000"
37
],
38
[
39
"Cedric Kelly",
40
"Senior Javascript Developer",
41
"Edinburgh",
42
"6224",
43
"2012/03/29",
44
"$433,060"
45
],
46
[
47
"Airi Satou",
48
"Accountant",
49
"Tokyo",
50
"5407",
51
"2008/11/28",
52
"$162,700"
53
],
54
[
55
"Brielle Williamson",
56
"Integration Specialist",
57
"New York",
58
"4804",
59
"2012/12/02",
60
"$372,000"
61
],
62
[
63
"Herrod Chandler",
64
"Sales Assistant",
65
"San Francisco",
66
"9608",
67
"2012/08/06",
68
"$137,500"
69
],
70
[
71
"Rhona Davidson",
72
"Integration Specialist",
73
"Tokyo",
74
"6200",
75
"2010/10/14",
76
"$327,900"
77
],
78
[
79
"Colleen Hurst",
80
"Javascript Developer",
81
"San Francisco",
82
"2360",
83
"2009/09/15",
84
"$205,500"
85
],
86
[
87
"Sonya Frost",
88
"Software Engineer",
89
"Edinburgh",
90
"1667",
91
"2008/12/13",
92
"$103,600"
93
],
94
[
95
"Jena Gaines",
96
"Office Manager",
97
"London",
98
"3814",
99
"2008/12/19",
100
"$90,560"
101
],
102
[
103
"Quinn Flynn",
104
"Support Lead",
105
"Edinburgh",
106
"9497",
107
"2013/03/03",
108
"$342,000"
109
],
110
[
111
"Charde Marshall",
112
"Regional Director",
113
"San Francisco",
114
"6741",
115
"2008/10/16",
116
"$470,600"
117
],
118
[
119
"Haley Kennedy",
120
"Senior Marketing Designer",
121
"London",
122
"3597",
123
"2012/12/18",
124
"$313,500"
125
],
126
[
127
"Tatyana Fitzpatrick",
128
"Regional Director",
129
"London",
130
"1965",
131
"2010/03/17",
132
"$385,750"
133
],
134
[
135
"Michael Silva",
136
"Marketing Designer",
137
"London",
138
"1581",
139
"2012/11/27",
140
"$198,500"
141
],
142
[
143
"Paul Byrd",
144
"Chief Financial Officer (CFO)",
145
"New York",
146
"3059",
147
"2010/06/09",
148
"$725,000"
149
],
150
[
151
"Gloria Little",
152
"Systems Administrator",
153
"New York",
154
"1721",
155
"2009/04/10",
156
"$237,500"
157
],
158
[
159
"Bradley Greer",
160
"Software Engineer",
161
"London",
162
"2558",
163
"2012/10/13",
164
"$132,000"
165
],
166
[
167
"Dai Rios",
168
"Personnel Lead",
169
"Edinburgh",
170
"2290",
171
"2012/09/26",
172
"$217,500"
173
],
174
[
175
"Jenette Caldwell",
176
"Development Lead",
177
"New York",
178
"1937",
179
"2011/09/03",
180
"$345,000"
181
],
182
[
183
"Yuri Berry",
184
"Chief Marketing Officer (CMO)",
185
"New York",
186
"6154",
187
"2009/06/25",
188
"$675,000"
189
],
190
[
191
"Caesar Vance",
192
"Pre-Sales Support",
193
"New York",
194
"8330",
195
"2011/12/12",
196
"$106,450"
197
],
198
[
199
"Doris Wilder",
200
"Sales Assistant",
201
"Sidney",
202
"3023",
203
"2010/09/20",
204
"$85,600"
205
],
206
[
207
"Angelica Ramos",
208
"Chief Executive Officer (CEO)",
209
"London",
210
"5797",
211
"2009/10/09",
212
"$1,200,000"
213
],
214
[
215
"Gavin Joyce",
216
"Developer",
217
"Edinburgh",
218
"8822",
219
"2010/12/22",
220
"$92,575"
221
],
222
[
223
"Jennifer Chang",
224
"Regional Director",
225
"Singapore",
226
"9239",
227
"2010/11/14",
228
"$357,650"
229
],
230
[
231
"Brenden Wagner",
232
"Software Engineer",
233
"San Francisco",
234
"1314",
235
"2011/06/07",
236
"$206,850"
237
],
238
[
239
"Fiona Green",
240
"Chief Operating Officer (COO)",
241
"San Francisco",
242
"2947",
243
"2010/03/11",
244
"$850,000"
245
],
246
[
247
"Shou Itou",
248
"Regional Marketing",
249
"Tokyo",
250
"8899",
251
"2011/08/14",
252
"$163,000"
253
],
254
[
255
"Michelle House",
256
"Integration Specialist",
257
"Sidney",
258
"2769",
259
"2011/06/02",
260
"$95,400"
261
],
262
[
263
"Suki Burks",
264
"Developer",
265
"London",
266
"6832",
267
"2009/10/22",
268
"$114,500"
269
],
270
[
271
"Prescott Bartlett",
272
"Technical Author",
273
"London",
274
"3606",
275
"2011/05/07",
276
"$145,000"
277
],
278
[
279
"Gavin Cortez",
280
"Team Leader",
281
"San Francisco",
282
"2860",
283
"2008/10/26",
284
"$235,500"
285
],
286
[
287
"Martena Mccray",
288
"Post-Sales support",
289
"Edinburgh",
290
"8240",
291
"2011/03/09",
292
"$324,050"
293
],
294
[
295
"Unity Butler",
296
"Marketing Designer",
297
"San Francisco",
298
"5384",
299
"2009/12/09",
300
"$85,675"
301
],
302
[
303
"Howard Hatfield",
304
"Office Manager",
305
"San Francisco",
306
"7031",
307
"2008/12/16",
308
"$164,500"
309
],
310
[
311
"Hope Fuentes",
312
"Secretary",
313
"San Francisco",
314
"6318",
315
"2010/02/12",
316
"$109,850"
317
],
318
[
319
"Vivian Harrell",
320
"Financial Controller",
321
"San Francisco",
322
"9422",
323
"2009/02/14",
324
"$452,500"
325
],
326
[
327
"Timothy Mooney",
328
"Office Manager",
329
"London",
330
"7580",
331
"2008/12/11",
332
"$136,200"
333
],
334
[
335
"Jackson Bradshaw",
336
"Director",
337
"New York",
338
"1042",
339
"2008/09/26",
340
"$645,750"
341
],
342
[
343
"Olivia Liang",
344
"Support Engineer",
345
"Singapore",
346
"2120",
347
"2011/02/03",
348
"$234,500"
349
],
350
[
351
"Bruno Nash",
352
"Software Engineer",
353
"London",
354
"6222",
355
"2011/05/03",
356
"$163,500"
357
],
358
[
359
"Sakura Yamamoto",
360
"Support Engineer",
361
"Tokyo",
362
"9383",
363
"2009/08/19",
364
"$139,575"
365
],
366
[
367
"Thor Walton",
368
"Developer",
369
"New York",
370
"8327",
371
"2013/08/11",
372
"$98,540"
373
],
374
[
375
"Finn Camacho",
376
"Support Engineer",
377
"San Francisco",
378
"2927",
379
"2009/07/07",
380
"$87,500"
381
],
382
[
383
"Serge Baldwin",
384
"Data Coordinator",
385
"Singapore",
386
"8352",
387
"2012/04/09",
388
"$138,575"
389
],
390
[
391
"Zenaida Frank",
392
"Software Engineer",
393
"New York",
394
"7439",
395
"2010/01/04",
396
"$125,250"
397
],
398
[
399
"Zorita Serrano",
400
"Software Engineer",
401
"San Francisco",
402
"4389",
403
"2012/06/01",
404
"$115,000"
405
],
406
[
407
"Jennifer Acosta",
408
"Junior Javascript Developer",
409
"Edinburgh",
410
"3431",
411
"2013/02/01",
412
"$75,650"
413
],
414
[
415
"Cara Stevens",
416
"Sales Assistant",
417
"New York",
418
"3990",
419
"2011/12/06",
420
"$145,600"
421
],
422
[
423
"Hermione Butler",
424
"Regional Director",
425
"London",
426
"1016",
427
"2011/03/21",
428
"$356,250"
429
],
430
[
431
"Lael Greer",
432
"Systems Administrator",
433
"London",
434
"6733",
435
"2009/02/27",
436
"$103,500"
437
],
438
[
439
"Jonas Alexander",
440
"Developer",
441
"San Francisco",
442
"8196",
443
"2010/07/14",
444
"$86,500"
445
],
446
[
447
"Shad Decker",
448
"Regional Director",
449
"Edinburgh",
450
"6373",
451
"2008/11/13",
452
"$183,000"
453
],
454
[
455
"Michael Bruce",
456
"Javascript Developer",
457
"Singapore",
458
"5384",
459
"2011/06/27",
460
"$183,000"
461
],
462
[
463
"Donna Snider",
464
"Customer Support",
465
"New York",
466
"4226",
467
"2011/01/25",
468
"$112,000"
469
]
470
]
471
}
472
Console errors: 0