HTML
xxxxxxxxxx
1
<section class="intro">
2
<div class="gradient-custom h-100">
3
<div class="mask d-flex align-items-center h-100">
4
<div class="container">
5
<div class="row justify-content-center">
6
<div class="col-12">
7
<div id="datatable"></div>
8
</div>
9
</div>
10
</div>
11
</div>
12
</div>
13
</section>
CSS
xxxxxxxxxx
1
html,
2
body,
3
.intro {
4
height: 100%;
5
}
6
7
.gradient-custom {
8
/* fallback for old browsers */
9
background: #c471f5;
10
11
/* Chrome 10-25, Safari 5.1-6 */
12
background: -webkit-linear-gradient(to top, rgba(196, 113, 245, 1), rgba(250, 113, 205, 1));
13
14
/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
15
background: linear-gradient(to top, rgba(196, 113, 245, 1), rgba(250, 113, 205, 1))
16
}
JS
xxxxxxxxxx
1
const basicData = {
2
columns: [{
3
label: 'EMPLOYEES',
4
field: 'employees',
5
sort: true,
6
width: 300,
7
fixed: true
8
},
9
{
10
label: 'POSITION',
11
field: 'position',
12
sort: false,
13
width: 200
14
},
15
{
16
label: 'START DATE',
17
field: 'date',
18
sort: false,
19
width: 200,
20
},
21
{
22
label: 'LAST ACTIVITY',
23
field: 'activity',
24
sort: false,
25
width: 200
26
},
27
{
28
label: 'CONTACTS',
29
field: 'contacts',
30
sort: true,
31
width: 200
32
},
33
{
34
label: 'AGE',
35
field: 'Age',
36
sort: false,
37
width: 200,
38
},
39
{
40
label: 'ADDRESS',
41
field: 'address',
42
sort: false,
43
width: 200,
44
},
45
{
46
label: 'SALARY',
47
field: 'salary',
48
sort: false,
49
width: 200,
50
},
51
],
52
rows: [
53
['Tiger Nixon', 'System Architect', '2011/04/25', '2021/03/08', 'tnixon12@example.com', 61, 'Edinburgh', '$320,800'],
54
['Sonya Frost', 'Software Engineer', '2008/12/13', '2021/03/08', 'sfrost34@example.com', 23, 'Edinburgh', '$103,600'],
55
['Jena Gaines', 'Office Manager', '2008/12/19', '2021/03/08', 'jgaines75@example.com', 30, 'London', '$90,560'],
56
['Quinn Flynn', 'Support Lead', '2013/03/03', '2021/03/08', 'qflyn09@example.com', 22, 'Edinburgh', '$342,000'],
57
['Charde Marshall', 'Regional Director', '2008/10/16', '2021/03/08', 'cmarshall28@example.com', 36, 'San Francisco', '$470,600'],
58
['Haley Kennedy', 'Senior Marketing Designer', '2012/12/18', '2021/03/08', 'hkennedy63@example.com', 43, 'London', '$313,500'],
59
['Tatyana Fitzpatrick', 'Regional Director', '2010/03/17', '2021/03/08', 'tfitzpatrick00@example.com', 19, 'Warsaw', '$385,750'],
60
],
61
};
62
63
const datatable = document.getElementById('datatable');
64
65
new mdb.Datatable(datatable, basicData);
Console errors: 0