-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtables.html
260 lines (257 loc) · 6.95 KB
/
tables.html
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
<h2>Tables</h2>
<p>Two type of tables are commonly used, static and interactive. For interactive tables we use jQuery plug-in <a href="http://www.datatables.net/" target="_blank">DataTables</a>. All tables have fluid layout. If there is not many column and table is previewed on largr screen table width shouldnt be 100% in order to make more user friendly</p>
<h3>Static Table</h3>
<p>Static table should have correct mark up.</p>
<table class="table-1">
<tr>
<th>Name</th>
<th>Matched Cpls</th>
<th>Year</th>
<th>Last Modified</th>
</tr>
<tr>
<td>Across The Universe</td>
<td>1</td>
<td>2014</td>
<td>2013-11-04 13:21:31</td>
</tr>
<tr>
<td>A Curious Life</td>
<td>1</td>
<td>2013</td>
<td>2014-02-03 04:00:05</td>
</tr>
<tr>
<td>Adaptation</td>
<td>2</td>
<td>2014</td>
<td>2013-11-04 13:21:23</td>
</tr>
<tr>
<td>Admission</td>
<td>3</td>
<td>2014</td>
<td>2013-11-04 13:21:49</td>
</tr>
<tr>
<td>Adrift</td>
<td>2</td>
<td>2013</td>
<td>2014-02-03 04:00:05</td>
</tr>
<tr>
<td>Adventure in Greece</td>
<td>1</td>
<td>2014</td>
<td>2013-11-04 13:21:31</td>
</tr>
</table>
<h4>HTML</h4>
<pre class="code" data-language="html">
<table class="table-1">
<tr>
<th>Name</th>
<th>Matched Cpls</th>
<th>Year</th>
<th>Last Modified</th>
</tr>
<tr>
<td>Across The Universe</td>
<td>1</td>
<td>2014</td>
<td>2013-11-04 13:21:31</td>
</tr>
</table>
</pre>
<h3>Interactive table / DataTable</h3>
<p>Interactive tables have fluid layout with fixed headers. Search should be placed outside tables in case we need to add other filters. Set up information can be find <a href="http://www.datatables.net/manual/installation" target="_blank">here</a>. Do not add CSS file as we have our costum styling.</p>
<div class="table-filters"></div>
<table id="data-table" class="display sort-table">
<thead>
<tr>
<th>CPL Title</th>
<th>Valid From</th>
<th>Valid To</th>
<th>Complex</th>
<th>Screen</th>
<th>Delivery Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>JAUJA-4-3_FTR_F-133_QSA-QSA_INT-TD_51_2K_XX_20140821_TDI_VF</td>
<td>2014-09-17 23:00:00</td>
<td>2014-09-28 07:00:00</td>
<td>IES Sade Antiguo Berri</td>
<td>7</td>
<td>Deleted on TMS</td>
</tr>
<tr>
<td>BELLE_FTR-1_S_ES-XX_ES_51_2K_FX_20140421_DSP_OV</td>
<td>2014-08-13 23:00:00</td>
<td>2014-11-06 06:59:00</td>
<td>IES Sade Principe</td>
<td>1</td>
<td>Delivered</td>
</tr>
<tr>
<td>BARBECUE_FTR_F_ES-XX_ES_51_2K_ACON_20140611_YBA_OV</td>
<td>2014-07-20 01:00:01</td>
<td>2014-10-30 23:59:59</td>
<td>IES Sade Principe</td>
<td>1</td>
<td>Delivered</td>
</tr>
<tr>
<td>AMOR-CRIMEN_FTR_S_ES-XX_51_2K_20140828_ADC_VF</td>
<td>014-09-02 14:48:36</td>
<td>2014-11-07 11:00:00</td>
<td>IES Sade Principe</td>
<td>1</td>
<td>Delivered</td>
</tr>
</tbody>
</table>
<h4>HTML</h4>
<pre class="code" data-language="html">
<div class="table-filters"></div>
<table id="data-table" class="display">
<thead>
<tr>
<th>CPL Title</th>
<th>Valid From</th>
<th>Valid To</th>
<th>Complex</th>
<th>Screen</th>
<th>Delivery Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>AMOR-CRIMEN_FTR_S_ES-XX_51_2K_20140828_ADC_VF</td>
<td>014-09-02 14:48:36</td>
<td>2014-11-07 11:00:00</td>
<td>IES Sade Principe</td>
<td>1</td>
<td>Delivered</td>
</tr>
</tbody>
</table>
</pre>
<h4>CSS</h4>
<pre class="code" data-language="css">
#data-table_filter {
margin-bottom:15px;
}
#data-table_filter .icon-search {
position:relative;
top:2px;
left:-20px;
color:#ccc;
}
.dataTables_scroll {
border:solid 1px #ccc;
border-bottom:none;
}
/*SORTING*/
th.sorting_asc, th.sorting_desc, th.sorting {
padding-right:23px;
cursor:pointer;
}
th.sorting_asc span:before, th.sorting_desc span:before, th.sorting:hover span:before{
content: "\78";
font-family: 'icomoon';
font-size:16px;
color:$primary-blue;
float:right;
margin-right:-20px;
height:0;
}
th.sorting_desc span:before {
content: "\7a";
}
th.sorting:hover span:before {
color:#A8A8A8;
}
/*FOOTER*/
.dt-footer {
border:solid 1px #ccc;
border-top:none;
background:#f0f0f0;
padding:6px;
font-size:13px;
position:relative;
color:#A8A8A8;
}
.dt-footer .dataTables_paginate {
position:absolute;
right:6px;
top:6px;
font-size:16px;
}
.dataTables_paginate a.disabled{
color:#B8B8B8;
cursor:default;
}
</pre>
<h4>Java Script</h4>
<pre class="code" data-language="js">
$(document).ready(function(){
$('#data-table').DataTable({
sDom: "frt<'dt-footer'ip>",
pagingType: "simple",
bSort: true,
bSortClasses: true,
sScrollY: "auto",
sScrollX: "100%",
'oLanguage':{
'sSearch': '',
'oPaginate': {
'sNext': '<span class="icon-next" title="Next"></span>',
'sPrevious': '<span class="icon-prev" title="Previous"></span>'
}
},
'aoColumns': [
{ "sClass": "cpl-title" },
{ "sWidth": "160px" },
{ "sWidth": "160px" },
null,
null,
null
]
});
$('div.dataTables_filter').appendTo('.table-filters'); //Places search filter outside table
$('.main-content input[type="search"]').after('<span class="icon-search"></span>'); // Adds search icon to datatable search input
$('.sort-table.dataTable th').append('<span></span>'); //Adds span for arrow down for sorting table
});
</pre>
<script>
$(document).ready(function(){
$('#data-table').DataTable({
sDom: "frt<'dt-footer'ip>",
pagingType: "simple",
bSort: true,
bSortClasses: true,
sScrollY: "auto",
sScrollX: "100%",
'oLanguage':{
'sSearch': '',
'oPaginate': {
'sNext': '<span class="icon-next" title="Next"></span>',
'sPrevious': '<span class="icon-prev" title="Previous"></span>'
}
},
'aoColumns': [
{ "sClass": "cpl-title" },
{ "sWidth": "160px" },
{ "sWidth": "160px" },
null,
null,
null
]
});
$('div.dataTables_filter').appendTo('.table-filters'); //Places search filter outside table
$('.main-content input[type="search"]').after('<span class="icon-search"></span>'); // Adds search icon to datatable search input
$('.sort-table.dataTable th').append('<span></span>'); //Adds span for arrow down for sorting table
});
</script>