table_bootstrap.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>H+ 后台主题UI框架 - Bootstrap Table</title>
  7. <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
  8. <meta name="description" content="H+是一个完全响应式,基于Bootstrap3最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术">
  9. <link rel="shortcut icon" href="favicon.ico"> <link href="../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
  10. <link href="../css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
  11. <link href="../css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
  12. <link href="../css/animate.min.css" rel="stylesheet">
  13. <link href="../css/style.min.css?v=4.1.0" rel="stylesheet">
  14. </head>
  15. <body class="gray-bg">
  16. <div class="wrapper wrapper-content animated fadeInRight">
  17. <div class="ibox float-e-margins">
  18. <div class="ibox-title">
  19. <h5>Bootstrap table <a href="http://bootstrap-table.wenzhixin.net.cn/zh-cn/" target="_blank">http://bootstrap-table.wenzhixin.net.cn/zh-cn/</a></h5>
  20. <div class="ibox-tools">
  21. <a class="collapse-link">
  22. <i class="fa fa-chevron-up"></i>
  23. </a>
  24. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  25. <i class="fa fa-wrench"></i>
  26. </a>
  27. <ul class="dropdown-menu dropdown-user">
  28. <li><a href="#">选项1</a>
  29. </li>
  30. <li><a href="#">选项2</a>
  31. </li>
  32. </ul>
  33. <a class="close-link">
  34. <i class="fa fa-times"></i>
  35. </a>
  36. </div>
  37. </div>
  38. <div class="ibox-content">
  39. <p>Bootstrap table是国人开发的一款基于 Bootstrap 的 jQuery 表格插件,通过简单的设置,就可以拥有强大的单选、多选、排序、分页,以及编辑、导出、过滤(扩展)等等的功能。目前在github上已经有2600多个Star,可见其受欢迎程度。</p>
  40. <ul>
  41. <li>支持 Bootstrap 3 和 Bootstrap 2</li>
  42. <li>自适应界面</li>
  43. <li>固定表头</li>
  44. <li>非常丰富的配置参数</li>
  45. <li>直接通过标签使用</li>
  46. <li>显示/隐藏列</li>
  47. <li>显示/隐藏表头</li>
  48. <li>通过 AJAX 获取 JSON 格式的数据</li>
  49. <li>支持排序</li>
  50. <li>格式化表格</li>
  51. <li>支持单选或者多选</li>
  52. <li>强大的分页功能</li>
  53. <li>支持卡片视图</li>
  54. <li>支持多语言</li>
  55. <li>支持插件</li>
  56. </ul>
  57. </div>
  58. </div>
  59. <div class="ibox float-e-margins">
  60. <div class="ibox-title">
  61. <h5>基本</h5>
  62. <div class="ibox-tools">
  63. <a class="collapse-link">
  64. <i class="fa fa-chevron-up"></i>
  65. </a>
  66. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  67. <i class="fa fa-wrench"></i>
  68. </a>
  69. <ul class="dropdown-menu dropdown-user">
  70. <li><a href="#">选项1</a>
  71. </li>
  72. <li><a href="#">选项2</a>
  73. </li>
  74. </ul>
  75. <a class="close-link">
  76. <i class="fa fa-times"></i>
  77. </a>
  78. </div>
  79. </div>
  80. <div class="ibox-content">
  81. <div class="row row-lg">
  82. <div class="col-sm-6">
  83. <h4 class="example-title">从URL加载</h4>
  84. <div class="example">
  85. <table data-toggle="table" data-url="../js/demo/table_base.json" data-height="250" data-mobile-responsive="true">
  86. <thead>
  87. <tr>
  88. <th data-field="Tid">ID</th>
  89. <th data-field="First">姓名</th>
  90. <th data-field="sex">性别</th>
  91. <th data-field="Score">评分</th>
  92. </tr>
  93. </thead>
  94. </table>
  95. </div>
  96. </div>
  97. <div class="col-sm-6">
  98. <h4 class="example-title">从数据中加载</h4>
  99. <div class="example">
  100. <table id="exampleTableFromData" data-mobile-responsive="true">
  101. <thead>
  102. <tr>
  103. <th data-field="Tid">ID</th>
  104. <th data-field="First">姓名</th>
  105. <th data-field="sex">性别</th>
  106. <th data-field="Score">评分</th>
  107. </tr>
  108. </thead>
  109. </table>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <!-- End Panel Basic -->
  116. <!-- Panel Style -->
  117. <div class="ibox float-e-margins">
  118. <div class="ibox-title">
  119. <h5>样式</h5>
  120. <div class="ibox-tools">
  121. <a class="collapse-link">
  122. <i class="fa fa-chevron-up"></i>
  123. </a>
  124. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  125. <i class="fa fa-wrench"></i>
  126. </a>
  127. <ul class="dropdown-menu dropdown-user">
  128. <li><a href="#">选项1</a>
  129. </li>
  130. <li><a href="#">选项2</a>
  131. </li>
  132. </ul>
  133. <a class="close-link">
  134. <i class="fa fa-times"></i>
  135. </a>
  136. </div>
  137. </div>
  138. <div class="ibox-content">
  139. <div class="row row-lg">
  140. <div class="col-sm-6">
  141. <!-- Example Classes -->
  142. <div class="example-wrap">
  143. <h4 class="example-title">类名称</h4>
  144. <div class="example">
  145. <table data-toggle="table" data-classes="table table-hover table-condensed" data-url="../js/demo/table_base.json" data-striped="true" data-height="250" data-mobile-responsive="true">
  146. <thead>
  147. <tr>
  148. <th data-field="Tid">ID</th>
  149. <th data-field="First">姓名</th>
  150. <th data-field="sex">性别</th>
  151. <th data-field="Score">评分</th>
  152. </tr>
  153. </thead>
  154. </table>
  155. </div>
  156. </div>
  157. <!-- End Example Classes -->
  158. </div>
  159. <div class="col-sm-6">
  160. <!-- Example Align -->
  161. <div class="example-wrap">
  162. <h4 class="example-title">对齐</h4>
  163. <div class="example">
  164. <table data-toggle="table" data-url="../js/demo/bootstrap_table_test2.json" data-mobile-responsive="true">
  165. <thead>
  166. <tr>
  167. <th data-field="name" data-halign="right" data-align="center">名称</th>
  168. <th data-field="star" data-halign="center" data-align="left">Star</th>
  169. <th data-field="description" data-halign="left" data-align="right">描述</th>
  170. </tr>
  171. </thead>
  172. </table>
  173. </div>
  174. </div>
  175. <!-- End Example Align -->
  176. </div>
  177. <div class="clearfix hidden-xs"></div>
  178. <div class="col-sm-6">
  179. <!-- Example Rowstyle -->
  180. <div class="example-wrap margin-sm-0">
  181. <h4 class="example-title">行样式</h4>
  182. <div class="example">
  183. <table data-toggle="table" data-url="../js/demo/table_base.json" data-mobile-responsive="true" data-row-style="rowStyle" data-height="250">
  184. <thead>
  185. <tr>
  186. <th data-field="Tid">ID</th>
  187. <th data-field="First">姓名</th>
  188. <th data-field="sex">性别</th>
  189. <th data-field="Score">评分</th>
  190. </tr>
  191. </thead>
  192. </table>
  193. </div>
  194. </div>
  195. <!-- End Example Rowstyle -->
  196. </div>
  197. <div class="col-sm-6">
  198. <!-- Example Cellstyle -->
  199. <div class="example-wrap">
  200. <h4 class="example-title">列样式</h4>
  201. <div class="example">
  202. <table data-toggle="table" data-url="../js/demo/bootstrap_table_test2.json" data-mobile-responsive="true">
  203. <thead>
  204. <tr>
  205. <th data-field="name" data-cell-style="cellStyle">名称</th>
  206. <th data-field="star">Star</th>
  207. <th data-field="description">描述</th>
  208. </tr>
  209. </thead>
  210. </table>
  211. </div>
  212. </div>
  213. <!-- End Example Cellstyle -->
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. <!-- End Panel Style -->
  219. <!-- Panel Sort & Hideheader -->
  220. <div class="ibox float-e-margins">
  221. <div class="ibox-title">
  222. <h5>排序&amp;隐藏头部</h5>
  223. <div class="ibox-tools">
  224. <a class="collapse-link">
  225. <i class="fa fa-chevron-up"></i>
  226. </a>
  227. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  228. <i class="fa fa-wrench"></i>
  229. </a>
  230. <ul class="dropdown-menu dropdown-user">
  231. <li><a href="#">选项1</a>
  232. </li>
  233. <li><a href="#">选项2</a>
  234. </li>
  235. </ul>
  236. <a class="close-link">
  237. <i class="fa fa-times"></i>
  238. </a>
  239. </div>
  240. </div>
  241. <div class="ibox-content">
  242. <div class="row row-lg">
  243. <div class="col-sm-6">
  244. <!-- Example Basic Sort -->
  245. <div class="example-wrap">
  246. <h4 class="example-title">基本排序</h4>
  247. <div class="example">
  248. <table data-toggle="table" data-url="../js/demo/table_base.json" data-height="250" data-sort-name="First" data-sort-order="desc" data-mobile-responsive="true">
  249. <thead>
  250. <tr>
  251. <th data-field="Tid" data-sortable="true">ID</th>
  252. <th data-field="First" data-sortable="true">姓名</th>
  253. <th data-field="sex" data-sortable="true">性别</th>
  254. </tr>
  255. </thead>
  256. </table>
  257. </div>
  258. </div>
  259. <!-- End Example Basic Sort -->
  260. </div>
  261. <div class="col-sm-6">
  262. <!-- Example Format Sort -->
  263. <div class="example-wrap margin-sm-0">
  264. <h4 class="example-title">格式排序</h4>
  265. <div class="example">
  266. <table data-toggle="table" data-url="../js/demo/bootstrap_table_test2.json" data-mobile-responsive="true">
  267. <thead>
  268. <tr>
  269. <th data-field="name" data-formatter="nameFormatter">名称</th>
  270. <th data-field="star" data-formatter="starsFormatter">Star</th>
  271. <th data-field="license">许可</th>
  272. <th data-field="url">地址</th>
  273. </tr>
  274. </thead>
  275. </table>
  276. </div>
  277. </div>
  278. <!-- End Example Format Sort -->
  279. </div>
  280. <div class="clearfix hidden-xs"></div>
  281. <div class="col-sm-6">
  282. <!-- Example Custom Sort -->
  283. <div class="example-wrap">
  284. <h4 class="example-title">自定义排序</h4>
  285. <div class="example">
  286. <table data-toggle="table" data-url="../js/demo/table_base.json" data-height="250" data-sort-name="Score" data-sort-order="desc" data-mobile-responsive="true">
  287. <thead>
  288. <tr>
  289. <th data-field="Tid" data-align="center" data-sortable="true">ID</th>
  290. <th data-field="First" data-align="left" data-sortable="true">姓名</th>
  291. <th data-field="Score" data-sortable="true" data-sorter="scoreSorter">评分</th>
  292. </tr>
  293. </thead>
  294. </table>
  295. </div>
  296. </div>
  297. <!-- End Example Custom Sort -->
  298. </div>
  299. <div class="col-sm-6">
  300. <!-- Example Hide Header -->
  301. <div class="example-wrap">
  302. <h4 class="example-title">隐藏头部</h4>
  303. <div class="example">
  304. <table data-toggle="table" data-url="../js/demo/table_base.json" data-height="250" data-show-header="false" data-mobile-responsive="true">
  305. <thead>
  306. <tr>
  307. <th data-field="Tid">ID</th>
  308. <th data-field="First">姓名</th>
  309. <th data-field="sex">性别</th>
  310. <th data-field="Score">评分</th>
  311. </tr>
  312. </thead>
  313. </table>
  314. </div>
  315. </div>
  316. <!-- End Example Hide Header -->
  317. </div>
  318. </div>
  319. </div>
  320. </div>
  321. <!-- End Panel Sort & Hideheader -->
  322. <!-- Panel Columns & Select -->
  323. <div class="ibox float-e-margins">
  324. <div class="ibox-title">
  325. <h5>列&amp;选择</h5>
  326. <div class="ibox-tools">
  327. <a class="collapse-link">
  328. <i class="fa fa-chevron-up"></i>
  329. </a>
  330. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  331. <i class="fa fa-wrench"></i>
  332. </a>
  333. <ul class="dropdown-menu dropdown-user">
  334. <li><a href="#">选项1</a>
  335. </li>
  336. <li><a href="#">选项2</a>
  337. </li>
  338. </ul>
  339. <a class="close-link">
  340. <i class="fa fa-times"></i>
  341. </a>
  342. </div>
  343. </div>
  344. <div class="ibox-content">
  345. <div class="row row-lg">
  346. <!-- Basic Columns -->
  347. <div class="col-sm-6">
  348. <!-- Example Basic Columns -->
  349. <div class="example-wrap">
  350. <h4 class="example-title">基本列</h4>
  351. <div class="example">
  352. <table id="exampleTableColumns" data-mobile-responsive="true">
  353. <thead>
  354. <tr>
  355. <th data-field="state" data-radio="true"></th>
  356. <th data-field="name" data-switchable="false">名称</th>
  357. <th data-field="price">价格</th>
  358. <th data-field="column1">列1</th>
  359. <th data-field="column2" data-visible="false">列2</th>
  360. <th data-field="column3" data-switchable="false">列3</th>
  361. <th data-field="column4" data-visible="false">列4</th>
  362. </tr>
  363. </thead>
  364. </table>
  365. </div>
  366. </div>
  367. <!-- End Example Basic Columns -->
  368. </div>
  369. <div class="col-sm-6">
  370. <!-- Example Large Columns -->
  371. <div class="example-wrap">
  372. <h4 class="example-title">数据较多的列</h4>
  373. <div class="example">
  374. <table id="exampleTableLargeColumns" data-show-columns="true" data-height="400" data-mobile-responsive="true"></table>
  375. </div>
  376. </div>
  377. <!-- End Example Large Columns -->
  378. </div>
  379. <div class="clearfix hidden-xs"></div>
  380. <div class="col-sm-6">
  381. <!-- Example Radio Select -->
  382. <div class="example-wrap margin-sm-0">
  383. <h4 class="example-title">单选框</h4>
  384. <div class="example">
  385. <table data-toggle="table" data-url="../js/demo/bootstrap_table_test.json" data-height="299" data-click-to-select="true" data-select-item-name="myRadioName" data-mobile-responsive="true">
  386. <thead>
  387. <tr>
  388. <th data-field="state" data-radio="true"></th>
  389. <th data-field="name">名称</th>
  390. <th data-field="price">价格</th>
  391. <th data-field="column1">列1</th>
  392. </tr>
  393. </thead>
  394. </table>
  395. </div>
  396. </div>
  397. <!-- End Example Radio Select -->
  398. </div>
  399. <div class="col-sm-6">
  400. <!-- Example Checkbox Select -->
  401. <div class="example-wrap">
  402. <h4 class="example-title">复选框</h4>
  403. <div class="example">
  404. <table data-toggle="table" data-url="../js/demo/bootstrap_table_test.json" data-height="299" data-click-to-select="true" data-mobile-responsive="true">
  405. <thead>
  406. <tr>
  407. <th data-field="state" data-checkbox="true"></th>
  408. <th data-field="name">名称</th>
  409. <th data-field="price">价格</th>
  410. <th data-field="column1">列1</th>
  411. </tr>
  412. </thead>
  413. </table>
  414. </div>
  415. </div>
  416. <!-- End Example Checkbox Select -->
  417. </div>
  418. </div>
  419. </div>
  420. </div>
  421. <!-- End Panel Columns & Select -->
  422. <!-- Panel Other -->
  423. <div class="ibox float-e-margins">
  424. <div class="ibox-title">
  425. <h5>其他</h5>
  426. <div class="ibox-tools">
  427. <a class="collapse-link">
  428. <i class="fa fa-chevron-up"></i>
  429. </a>
  430. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  431. <i class="fa fa-wrench"></i>
  432. </a>
  433. <ul class="dropdown-menu dropdown-user">
  434. <li><a href="#">选项1</a>
  435. </li>
  436. <li><a href="#">选项2</a>
  437. </li>
  438. </ul>
  439. <a class="close-link">
  440. <i class="fa fa-times"></i>
  441. </a>
  442. </div>
  443. </div>
  444. <div class="ibox-content">
  445. <div class="row row-lg">
  446. <div class="col-sm-12">
  447. <!-- Example Card View -->
  448. <div class="example-wrap">
  449. <h4 class="example-title">卡片视图</h4>
  450. <div class="example">
  451. <table data-toggle="table" data-url="../js/demo/bootstrap_table_test2.json" data-card-view="true" data-mobile-responsive="true">
  452. <thead>
  453. <tr>
  454. <th data-field="name">名称</th>
  455. <th data-field="star">Star</th>
  456. <th data-field="license">许可</th>
  457. <th data-field="description">描述</th>
  458. <th data-field="url">地址</th>
  459. </tr>
  460. </thead>
  461. </table>
  462. </div>
  463. </div>
  464. <!-- End Example Card View -->
  465. </div>
  466. <div class="col-sm-12">
  467. <!-- Example Toolbar -->
  468. <div class="example-wrap">
  469. <h4 class="example-title">工具条</h4>
  470. <div class="example">
  471. <div class="btn-group hidden-xs" id="exampleToolbar" role="group">
  472. <button type="button" class="btn btn-outline btn-default">
  473. <i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
  474. </button>
  475. <button type="button" class="btn btn-outline btn-default">
  476. <i class="glyphicon glyphicon-heart" aria-hidden="true"></i>
  477. </button>
  478. <button type="button" class="btn btn-outline btn-default">
  479. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  480. </button>
  481. </div>
  482. <table id="exampleTableToolbar" data-mobile-responsive="true">
  483. <thead>
  484. <tr>
  485. <th data-field="name">名称</th>
  486. <th data-field="star">Star</th>
  487. <th data-field="license">许可</th>
  488. <th data-field="description">描述</th>
  489. <th data-field="url">地址</th>
  490. </tr>
  491. </thead>
  492. </table>
  493. </div>
  494. </div>
  495. <!-- End Example Toolbar -->
  496. </div>
  497. <div class="col-sm-12">
  498. <!-- Example Pagination -->
  499. <div class="example-wrap">
  500. <h4 class="example-title">分页:客户端</h4>
  501. <div class="example">
  502. <table id="exampleTablePagination" data-toggle="table" data-url="../js/demo/bootstrap_table_test.json" data-query-params="queryParams" data-mobile-responsive="true" data-height="400" data-pagination="true" data-icon-size="outline" data-search="true">
  503. <thead>
  504. <tr>
  505. <th data-field="state" data-checkbox="true"></th>
  506. <th data-field="id">ID</th>
  507. <th data-field="name">名称</th>
  508. <th data-field="price">价格</th>
  509. </tr>
  510. </thead>
  511. </table>
  512. </div>
  513. </div>
  514. <!-- End Example Pagination -->
  515. </div>
  516. <div class="col-sm-12">
  517. <!-- Example Events -->
  518. <div class="example-wrap">
  519. <h4 class="example-title">事件</h4>
  520. <div class="example">
  521. <div class="alert alert-success" id="examplebtTableEventsResult" role="alert">
  522. 事件结果
  523. </div>
  524. <div class="btn-group hidden-xs" id="exampleTableEventsToolbar" role="group">
  525. <button type="button" class="btn btn-outline btn-default">
  526. <i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
  527. </button>
  528. <button type="button" class="btn btn-outline btn-default">
  529. <i class="glyphicon glyphicon-heart" aria-hidden="true"></i>
  530. </button>
  531. <button type="button" class="btn btn-outline btn-default">
  532. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  533. </button>
  534. </div>
  535. <table id="exampleTableEvents" data-height="400" data-mobile-responsive="true">
  536. <thead>
  537. <tr>
  538. <th data-field="state" data-checkbox="true"></th>
  539. <th data-field="id">ID</th>
  540. <th data-field="name">名称</th>
  541. <th data-field="price">价格</th>
  542. </tr>
  543. </thead>
  544. </table>
  545. </div>
  546. </div>
  547. <!-- End Example Events -->
  548. </div>
  549. </div>
  550. </div>
  551. </div>
  552. <!-- End Panel Other -->
  553. </div>
  554. <script src="../js/jquery.min.js?v=2.1.4"></script>
  555. <script src="../js/bootstrap.min.js?v=3.3.6"></script>
  556. <script src="../js/content.min.js?v=1.0.0"></script>
  557. <script src="../js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
  558. <script src="../js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
  559. <script src="../js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
  560. <script src="../js/demo/bootstrap-table-demo.min.js"></script>
  561. </body>
  562. </html>