demo.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link href="js/bstable/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  6. <link href="js/bstable/css/bootstrap-table.css" rel="stylesheet" type="text/css" />
  7. <title>Title</title>
  8. </head>
  9. <body>
  10. <table id="table" style="width: 100%"></table>
  11. </body>
  12. <script src="js/jquery.js"></script>
  13. <script src="js/bstable/js/bootstrap.min.js"></script>
  14. <script src="js/bstable/js/bootstrap-table.js"></script>
  15. <script src="js/bstable/js/bootstrap-table-zh-CN.min.js"></script>
  16. <script>
  17. $(function () {
  18. $('#table').bootstrapTable({
  19. method: "get",
  20. striped: true,
  21. singleSelect: false,
  22. url: "json/note.json",
  23. dataType: "json",
  24. pagination: true, //分页
  25. pageSize: 4,
  26. pageNumber: 1,
  27. search: false, //显示搜索框
  28. contentType: "application/x-www-form-urlencoded",
  29. queryParams: null,
  30. columns: [
  31. {
  32. checkbox: "true",
  33. field: 'check',
  34. align: 'center',
  35. valign: 'middle',
  36. width:'25%'
  37. }
  38. ,
  39. {
  40. title: "编号",
  41. field: 'id',
  42. align: 'center',
  43. valign: 'middle',
  44. width:'25%'
  45. },
  46. {
  47. title: '标题',
  48. field: 'title',
  49. align: 'center',
  50. valign: 'middle',
  51. width:'25%'
  52. },
  53. {
  54. title: '类型',
  55. field: 'type',
  56. align: 'center',
  57. valign: 'middle',
  58. width:'25%'
  59. }
  60. ]
  61. });
  62. })
  63. </script>
  64. </html>