xxxxxxxxxx
1
<!DOCTYPE html>
2
<html lang="en">
3
4
<head>
5
<meta charset="utf-8">
6
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7
<meta name="theme-color" content="#000000">
8
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
9
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
10
<title>React App</title>
11
</head>
12
13
<body>
14
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.2.0/css/all.css" />
15
<link rel="stylesheet" href="https://static.fontawesome.com/css/fontawesome-app.css" />
16
<noscript>You need to enable JavaScript to run this app.</noscript>
17
<div id="root"></div>
18
</body>
19
20
</html>
21
1
1
xxxxxxxxxx
1
import React from "react";
2
import "./styles.css";
3
import { MDBDataTable } from "mdbreact";
4
5
const DatatablePage = () => {
6
const data = {
7
columns: [
8
{
9
label: "Name",
10
field: "name",
11
sort: "asc",
12
width: 150
13
},
14
{
15
label: "Position",
16
field: "position",
17
sort: "asc",
18
width: 270
19
},
20
{
21
label: "Office",
22
field: "office",
23
sort: "asc",
24
width: 200
25
},
26
{
27
label: "Age",
28
field: "age",
29
sort: "asc",
30
width: 100
31
},
32
{
33
label: "Start date",
34
field: "date",
35
sort: "asc",
36
width: 150
37
},
38
{
39
label: "Salary",
40
field: "salary",
41
sort: "asc",
42
width: 100
43
}
44
],
45
rows: [
46
{
47
name: "Tiger Nixon",
48
position: "System Architect",
49
office: "Edinburgh",
50
age: "61",
51
date: "2011/04/25",
52
salary: "$320"
53
},
54
{
55
name: "Garrett Winters",
56
position: "Accountant",
57
office: "Tokyo",
58
age: "63",
59
date: "2011/07/25",
60
salary: "$170"
61
},
62
{
63
name: "Ashton Cox",
64
position: "Junior Technical Author",
65
office: "San Francisco",
66
age: "66",
67
date: "2009/01/12",
68
salary: "$86"
69
},
70
{
71
name: "Cedric Kelly",
72
position: "Senior Javascript Developer",
73
office: "Edinburgh",
74
age: "22",
75
date: "2012/03/29",
76
salary: "$433"
77
},
78
{
79
name: "Airi Satou",
80
position: "Accountant",
81
office: "Tokyo",
82
age: "33",
83
date: "2008/11/28",
84
salary: "$162"
85
},
86
{
87
name: "Brielle Williamson",
88
position: "Integration Specialist",
89
office: "New York",
90
age: "61",
91
date: "2012/12/02",
92
salary: "$372"
93
},
94
{
95
name: "Herrod Chandler",
96
position: "Sales Assistant",
97
office: "San Francisco",
98
age: "59",
99
date: "2012/08/06",
100
salary: "$137"
101
},
102
{
103
name: "Rhona Davidson",
104
position: "Integration Specialist",
105
office: "Tokyo",
106
age: "55",
107
date: "2010/10/14",
108
salary: "$327"
109
},
110
{
111
name: "Colleen Hurst",
112
position: "Javascript Developer",
113
office: "San Francisco",
114
age: "39",
115
date: "2009/09/15",
116
salary: "$205"
117
},
118
{
119
name: "Tiger Nixon",
120
position: "System Architect",
121
office: "Edinburgh",
122
age: "61",
123
date: "2011/04/25",
124
salary: "$320"
125
},
126
{
127
name: "Garrett Winters",
128
position: "Accountant",
129
office: "Tokyo",
130
age: "63",
131
date: "2011/07/25",
132
salary: "$170"
133
},
134
{
135
name: "Ashton Cox",
136
position: "Junior Technical Author",
137
office: "San Francisco",
138
age: "66",
139
date: "2009/01/12",
140
salary: "$86"
141
},
142
{
143
name: "Cedric Kelly",
144
position: "Senior Javascript Developer",
145
office: "Edinburgh",
146
age: "22",
147
date: "2012/03/29",
148
salary: "$433"
149
},
150
{
151
name: "Airi Satou",
152
position: "Accountant",
153
office: "Tokyo",
154
age: "33",
155
date: "2008/11/28",
156
salary: "$162"
157
},
158
{
159
name: "Brielle Williamson",
160
position: "Integration Specialist",
161
office: "New York",
162
age: "61",
163
date: "2012/12/02",
164
salary: "$372"
165
},
166
{
167
name: "Herrod Chandler",
168
position: "Sales Assistant",
169
office: "San Francisco",
170
age: "59",
171
date: "2012/08/06",
172
salary: "$137"
173
},
174
{
175
name: "Rhona Davidson",
176
position: "Integration Specialist",
177
office: "Tokyo",
178
age: "55",
179
date: "2010/10/14",
180
salary: "$327"
181
},
182
{
183
name: "Colleen Hurst",
184
position: "Javascript Developer",
185
office: "San Francisco",
186
age: "39",
187
date: "2009/09/15",
188
salary: "$205"
189
}
190
]
191
};
192
193
return (
194
<MDBDataTable
195
scrollY
196
striped
197
bordered
198
small
199
data={data}
200
/>
201
);
202
};
203
204
export default function App() {
205
return (
206
<div className="App">
207
<DatatablePage></DatatablePage>
208
</div>
209
);
210
}
211
Console errors: 0