forked from olton/metroui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtables.html
More file actions
350 lines (304 loc) · 20.7 KB
/
Copy pathtables.html
File metadata and controls
350 lines (304 loc) · 20.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="product" content="Metro UI CSS Framework">
<meta name="description" content="Simple responsive css framework">
<meta name="author" content="Sergey S. Pimenov, Ukraine, Kiev">
<link href="css/metro-bootstrap.css" rel="stylesheet">
<link href="css/metro-bootstrap-responsive.css" rel="stylesheet">
<link href="css/docs.css" rel="stylesheet">
<link href="js/prettify/prettify.css" rel="stylesheet">
<!-- Load JavaScript Libraries -->
<script src="js/jquery/jquery.min.js"></script>
<script src="js/jquery/jquery.widget.min.js"></script>
<script src="js/jquery/jquery.mousewheel.js"></script>
<script src="js/prettify/prettify.js"></script>
<!-- Metro UI CSS JavaScript plugins -->
<script src="js/load-metro.js"></script>
<!-- Local JavaScript -->
<script src="js/docs.js"></script>
<script src="js/github.info.js"></script>
<title>Metro UI CSS : Metro Bootstrap CSS Library</title>
</head>
<body class="metro">
<header class="bg-dark" data-load="header.html"></header>
<div class="page">
<div class="page-region">
<div class="page-region-content">
<h1>
<a href="/"><i class="icon-arrow-left-3 fg-darker smaller"></i></a>
Tables<small class="on-right">definition</small>
</h1>
<h3 id="_default">Default table styles</h3>
<p class="description">
All tables has default styles: width <code>100%</code>, cell padding <code>10px</code> and text align <code>left</code>.
</p>
<div class="example">
<table class="table">
<thead>
<tr>
<th class="text-left">Name</th>
<th class="text-left">Time CP</th>
<th class="text-left">Network</th>
<th class="text-left">Traffic</th>
<th class="text-left">Tiles update</th>
</tr>
</thead>
<tbody>
<tr><td>Bing</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Internet Explorer</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Chrome</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>News</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Weather</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Music</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
</tbody>
<tfoot></tfoot>
</table>
</div>
<pre class="prettyprint linenums">
<table>...</table>
</pre>
<h3 id="_striped">Striped rows</h3>
<p class="description">
Adds zebra-striping to any table row within the <code><tbody></code> with class <code>.striped</code>.
</p>
<div class="example">
<table class="table striped3n">
<thead>
<tr>
<th class="text-left">Name</th>
<th class="text-left">Time CP</th>
<th class="text-left">Network</th>
<th class="text-left">Traffic</th>
<th class="text-left">Tiles update</th>
</tr>
</thead>
<tbody>
<tr><td>domain</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>desc</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>domain</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>desc</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>domain</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>desc</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>domain</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>desc</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>domain</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>desc</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>domain</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>desc</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
</tbody>
<tfoot></tfoot>
</table>
</div>
<div class="example">
<table class="table striped">
<thead>
<tr>
<th class="text-left">Name</th>
<th class="text-left">Time CP</th>
<th class="text-left">Network</th>
<th class="text-left">Traffic</th>
<th class="text-left">Tiles update</th>
</tr>
</thead>
<tbody>
<tr><td>Bing</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Internet Explorer</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Chrome</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>News</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Weather</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Music</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
</tbody>
<tfoot></tfoot>
</table>
</div>
<pre class="prettyprint linenums">
<table class="striped">...</table>
</pre>
<h3 id="_bordered">Bordered table</h3>
<p class="description">
Adds borders to any table with class <code>.bordered</code>.
</p>
<div class="example">
<table class="table bordered">
<thead>
<tr>
<th class="text-left">Name</th>
<th class="text-left">Time CP</th>
<th class="text-left">Network</th>
<th class="text-left">Traffic</th>
<th class="text-left">Tiles update</th>
</tr>
</thead>
<tbody>
<tr><td>Bing</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Internet Explorer</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Chrome</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>News</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Weather</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Music</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
</tbody>
<tfoot></tfoot>
</table>
</div>
<pre class="prettyprint linenums">
<table class="bordered">...</table>
</pre>
<h3 id="_hovered">Hovered table</h3>
<p class="description">
Enable a hover state on table rows within a <code><tbody></code>.
</p>
<div class="example">
<table class="table hovered">
<thead>
<tr>
<th class="text-left">Name</th>
<th class="text-left">Time CP</th>
<th class="text-left">Network</th>
<th class="text-left">Traffic</th>
<th class="text-left">Tiles update</th>
</tr>
</thead>
<tbody>
<tr><td>Bing</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Internet Explorer</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Chrome</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>News</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Weather</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Music</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
</tbody>
<tfoot></tfoot>
</table>
</div>
<pre class="prettyprint linenums">
<table class="hovered">...</table>
</pre>
<h3 id="_optional">Optional row classes</h3>
<p class="description">
For displaying optional rows you must add one of next classes for <code><tr></code>:
</p>
<ul>
<li class="fg-red">error</li>
<li class="fg-green">success</li>
<li class="fg-orange">warning</li>
<li class="fg-lightBlue">info</li>
<li>selected</li>
</ul>
<div class="example">
<table class="table">
<thead>
<tr>
<th class="text-left">Name</th>
<th class="text-left">Time CP</th>
<th class="text-left">Network</th>
<th class="text-left">Traffic</th>
<th class="text-left">Tiles update</th>
</tr>
</thead>
<tbody>
<tr class="error"><td>Bing</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr class="success"><td>Internet Explorer</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr class="warning"><td>Chrome</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr class="info"><td>News</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr><td>Music</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
<tr class="selected"><td>Weather</td><td class="right">0:00:01</td><td class="right">0,1 Mb</td><td class="right">0 Mb</td><td class="right">0,1 Mb</td></tr>
</tbody>
<tfoot></tfoot>
</table>
</div>
<pre class="prettyprint linenums">
<table>
<tr class="error">...</tr>
</table>
</pre>
<h3 id="_control">TableControl.js</h3>
<p class="description">This component in progress...</p>
<div class="example">
<div id="table1"></div>
<script>
function checkRow(el){
$(el).parents("tr").toggleClass("selected");
}
function checkAll(el){
var state = el.checked;
$(el).parents("table").find("tbody [type=checkbox]").each(function(index){
$(this).prop("checked", state);
if (state) {
$(this).parents("tr").addClass("selected");
} else {
$(this).parents("tr").removeClass("selected");
}
});
}
var table, table_data;
table_data = [
{_check:"<input type='checkbox' name='chk[]' value='1' onclick='checkRow(this)'>",id:"1",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{_check:"<input type='checkbox' name='chk[]' value='2' onclick='checkRow(this)'>",id:"2",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{_check:"<input type='checkbox' name='chk[]' value='3' onclick='checkRow(this)'>",id:"3",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{_check:"<input type='checkbox' name='chk[]' value='4' onclick='checkRow(this)'>",id:"4",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{_check:"<input type='checkbox' name='chk[]' value='5' onclick='checkRow(this)'>",id:"5",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{_check:"<input type='checkbox' name='chk[]' value='6' onclick='checkRow(this)'>",id:"6",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{_check:"<input type='checkbox' name='chk[]' value='7' onclick='checkRow(this)'>",id:"7",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{_check:"<input type='checkbox' name='chk[]' value='8' onclick='checkRow(this)'>",id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{_check:"<input type='checkbox' name='chk[]' value='9' onclick='checkRow(this)'>",id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}
];
$(function(){
table = $("#table1").tablecontrol({
cls: 'table hovered border myClass',
checkRow: true,
colModel: [
//{field: '_check', caption: "<input type='checkbox' onclick='checkAll(this)'>", width: 32, sortable: false, cls: 'text-center', hcls: "text-center"},
{field: 'id', caption: 'No', width: 50, sortable: false, cls: 'text-center', hcls: ""},
{field: 'invdate', caption: 'Date', width: 120, sortable: false, cls: 'text-center', hcls: ""},
{field: 'name', caption: 'Client', width: '', sortable: false, cls: 'text-left', hcls: "text-left"},
{field: 'amount', caption: 'Amount', width: '80', sortable: false, cls: 'text-right', hcls: "text-right"},
{field: 'tax', caption: 'Tax', width: '80', sortable: false, cls: 'text-right', hcls: "text-right"},
{field: 'total', caption: 'Total', width: '80', sortable: false, cls: 'text-right', hcls: "text-right"},
{field: 'note', caption: 'Notes', width: '', sortable: false, cls: 'span1', hcls: ""}
],
data: table_data
});
});
</script>
</div>
<pre class="prettyprint linenums">
var table, table_data;
table_data = [
{id:"1",invdate:"2007-04-02",name:"test",note:"note",amount:"100.00",tax:"10.00",total:"120.00"},
{id:"2",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"3",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"4",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"5",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"6",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"7",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}
];
$(function(){
table = $("#table1").tablecontrol({
cls: 'table hovered border myClass',
colModel: [
{field: 'id', caption: 'No', width: 50, sortable: false, cls: 'text-center', hcls: ""},
{field: 'invdate', caption: 'Date', width: 120, sortable: false, cls: 'text-center', hcls: ""},
{field: 'name', caption: 'Client', width: '', sortable: false, cls: 'text-left', hcls: "text-left"},
{field: 'amount', caption: 'Amount', width: '80', sortable: false, cls: 'text-right', hcls: "text-right"},
{field: 'tax', caption: 'Tax', width: '80', sortable: false, cls: 'text-right', hcls: "text-right"},
{field: 'total', caption: 'Total', width: '80', sortable: false, cls: 'text-right', hcls: "text-right"},
{field: 'note', caption: 'Notes', width: '', sortable: false, cls: 'span1', hcls: ""}
],
data: table_data
});
});
</pre>
</div>
</div>
<div class="page-footer">
<div class="page-footer-content">
<!--<div data-load="header.html"></div>-->
</div>
</div>
</div>
<script src="js/hitua.js"></script>
</body>
</html>