demo.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link rel="stylesheet" href="https://www.jq22.com/jquery/bootstrap-3.3.4.css">
  6. <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-table/1.16.0/bootstrap-table.css" rel="stylesheet">
  7. <title>Title</title>
  8. </head>
  9. <body>
  10. <table id="table" style="width: 100%"></table>
  11. </body>
  12. <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>
  13. <script src="https://www.jq22.com/jquery/bootstrap-3.3.4.js"></script>
  14. <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap-table/1.16.0/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>