stripe style table (search, paging)
DevOps/Web 2021. 7. 11. 00:40
html
<table id="example" class="stripe" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433,060</td>
</tr>
<tr>
<td>Airi Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162,700</td>
</tr>
............
<tr>
<td>Donna Snider</td>
<td>Customer Support</td>
<td>New York</td>
<td>27</td>
<td>2011/01/25</td>
<td>$112,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
javascript
$(document).ready(function() {
$('#example').DataTable();
} );
In addition to the above code, the following Javascript library files are loaded for use in this example:
https://code.jquery.com/jquery-3.5.1.js
https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js
css
The following CSS library files are loaded for use in this example to provide the styling of the table:
https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css
참고
'DevOps > Web' 카테고리의 다른 글
[chart.js] Chart.js 2.9.4(2.x) Pie Chart + 클릭 이벤트 + Label 활성화 ( Click Event + datalabels ) (0) | 2021.07.19 |
---|---|
web examples 추천 사이트 (0) | 2021.07.11 |
javascript/jquery foreach구문을 사용하여 json값 가져오기 (0) | 2021.07.11 |
html table cell에 여러 라인의 text를 출력 (0) | 2021.07.11 |
jQuery 테이블의 특정 행(row)값 가져오기 (0) | 2021.07.09 |