You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

713 lines
16 KiB

  1. ---
  2. layout : 'default'
  3. css : 'table'
  4. title : 'Table'
  5. description : 'Tables display collections of data grouped into rows'
  6. type : 'UI Collection'
  7. ---
  8. <script src="/javascript/table.js"></script>
  9. <%- @partial('header') %>
  10. <div class="main container">
  11. <div class="peek">
  12. <div class="ui vertical pointing secondary menu">
  13. <a class="active item">Types</a>
  14. <a class="item">States</a>
  15. <a class="item">Variations</a>
  16. </div>
  17. </div>
  18. <h2 class="ui dividing header">Types</h2>
  19. <div class="example">
  20. <h4 class="ui header">Table</h4>
  21. <p>A standard table</p>
  22. <div class="ui ignored positive icon message">
  23. <i class="mobile icon"></i>
  24. <div class="content">
  25. <h3 class="header">Responsive Element</h3>
  26. <p>Tables are designed to be responsive. Table cells will stack when a mobile viewport size is reached.</p>
  27. </div>
  28. </div>
  29. <table class="ui table">
  30. <thead>
  31. <th>Name</th>
  32. <th>Status</th>
  33. <th>Notes</th>
  34. </thead>
  35. <tbody>
  36. <tr>
  37. <td>John</td>
  38. <td>Approved</td>
  39. <td>None</td>
  40. </tr>
  41. <tr>
  42. <td>Jamie</td>
  43. <td>Approved</td>
  44. <td>Requires call</td>
  45. </tr>
  46. <tr>
  47. <td>Jill</td>
  48. <td>Denied</td>
  49. <td>None</td>
  50. </tr>
  51. </tbody>
  52. <tfoot>
  53. <th colspan="3">
  54. <div class="ui blue labeled icon button"><i class="user icon"></i> Add User</div>
  55. </th>
  56. </tfoot>
  57. </table>
  58. </div>
  59. <h2 class="ui dividing header">States</h2>
  60. <div class="example">
  61. <h4 class="ui header">Positive / Negative</h4>
  62. <p>A cell or row may let a user know whether a value is good or bad</p>
  63. <table class="ui table">
  64. <thead>
  65. <th>Name</th>
  66. <th>Status</th>
  67. <th>Notes</th>
  68. </thead>
  69. <tbody>
  70. <tr>
  71. <td>No Name Specified</td>
  72. <td>Unknown</td>
  73. <td class="negative">None</td>
  74. </tr>
  75. <tr class="positive">
  76. <td>Jimmy</td>
  77. <td><i class="icon checkmark"></i> Approved</td>
  78. <td>None</td>
  79. </tr>
  80. <tr>
  81. <td>Jamie</td>
  82. <td>Unknown</td>
  83. <td class="positive"><i class="icon close"></i> Requires call</td>
  84. </tr>
  85. <tr class="negative">
  86. <td>Jill</td>
  87. <td>Unknown</td>
  88. <td>None</td>
  89. </tr>
  90. </tbody>
  91. </table>
  92. </div>
  93. <h3 class="ui header">Cells</h3>
  94. <div class="example">
  95. <h4 class="ui header">Error</h4>
  96. <p>A cell or row may attention the user to an error or a negative value</p>
  97. <table class="ui table">
  98. <thead>
  99. <th>Name</th>
  100. <th>Status</th>
  101. <th>Notes</th>
  102. </thead>
  103. <tbody>
  104. <tr>
  105. <td>No Name Specified</td>
  106. <td>Approved</td>
  107. <td>None</td>
  108. </tr>
  109. <tr class="error">
  110. <td>Jimmy</td>
  111. <td>Cannot pull data</td>
  112. <td>None</td>
  113. </tr>
  114. <tr>
  115. <td>Jamie</td>
  116. <td>Approved</td>
  117. <td class="error"><i class="attention icon"></i> Classified</td>
  118. </tr>
  119. <tr>
  120. <td>Jill</td>
  121. <td>Approved</td>
  122. <td>None</td>
  123. </tr>
  124. </tbody>
  125. </table>
  126. </div>
  127. <div class="example">
  128. <h4 class="ui header">Warning</h4>
  129. <p>A cell or row may warn a user</p>
  130. <table class="ui table">
  131. <thead>
  132. <th>Name</th>
  133. <th>Status</th>
  134. <th>Notes</th>
  135. </thead>
  136. <tbody>
  137. <tr>
  138. <td>No Name Specified</td>
  139. <td>Unknown</td>
  140. <td>None</td>
  141. </tr>
  142. <tr class="warning">
  143. <td>Jimmy</td>
  144. <td><i class="attention icon"></i> Requires Action</td>
  145. <td>None</td>
  146. </tr>
  147. <tr>
  148. <td>Jamie</td>
  149. <td>Unknown</td>
  150. <td class="warning"><i class="attention icon"></i> Hostile</td>
  151. </tr>
  152. <tr>
  153. <td>Jill</td>
  154. <td>Unknown</td>
  155. <td>None</td>
  156. </tr>
  157. </tbody>
  158. </table>
  159. </div>
  160. <div class="example">
  161. <h4 class="ui header">Active</h4>
  162. <p>A cell or row can be active or selected by a user</p>
  163. <table class="ui table">
  164. <thead>
  165. <th>Name</th>
  166. <th>Status</th>
  167. <th>Notes</th>
  168. </thead>
  169. <tbody>
  170. <tr>
  171. <td>Jamie</td>
  172. <td>Approved</td>
  173. <td>Requires call</td>
  174. </tr>
  175. <tr class="active">
  176. <td>John</td>
  177. <td>Selected</td>
  178. <td>None</td>
  179. </tr>
  180. <tr>
  181. <td>Jamie</td>
  182. <td>Approved</td>
  183. <td>Requires call</td>
  184. </tr>
  185. <tr>
  186. <td class="active">Jill</td>
  187. <td>Approved</td>
  188. <td>None</td>
  189. </tr>
  190. </tbody>
  191. </table>
  192. </div>
  193. <div class="example">
  194. <h4 class="ui header">Disabled</h4>
  195. <p>A cell can be disabled</p>
  196. <table class="ui table">
  197. <thead>
  198. <th>Name</th>
  199. <th>Status</th>
  200. <th>Notes</th>
  201. </thead>
  202. <tbody>
  203. <tr class="disabled">
  204. <td>Jamie</td>
  205. <td>Approved</td>
  206. <td>Requires call</td>
  207. </tr>
  208. <tr>
  209. <td>John</td>
  210. <td>Selected</td>
  211. <td>None</td>
  212. </tr>
  213. <tr>
  214. <td>Jamie</td>
  215. <td>Approved</td>
  216. <td>Requires call</td>
  217. </tr>
  218. <tr>
  219. <td class="disabled">Jill</td>
  220. <td>Approved</td>
  221. <td>None</td>
  222. </tr>
  223. </tbody>
  224. </table>
  225. </div>
  226. <h2 class="ui dividing header">Variations</h2>
  227. <div class="example">
  228. <h4 class="ui header">Striped</h4>
  229. <p>A table can stripe alternate rows of content with a darker color to increase contrast</p>
  230. <table class="ui striped table">
  231. <thead>
  232. <th>Name</th>
  233. <th>Status</th>
  234. <th>Notes</th>
  235. </thead>
  236. <tbody>
  237. <tr>
  238. <td>John</td>
  239. <td>Approved</td>
  240. <td>None</td>
  241. </tr>
  242. <tr>
  243. <td>Jamie</td>
  244. <td>Approved</td>
  245. <td>Requires call</td>
  246. </tr>
  247. <tr>
  248. <td>Jill</td>
  249. <td>Denied</td>
  250. <td>None</td>
  251. </tr>
  252. </tbody>
  253. <tfoot>
  254. <th>3 People</th>
  255. <th>2 Approved</th>
  256. <th></th>
  257. </tfoot>
  258. </table>
  259. </div>
  260. <div class="example">
  261. <h4 class="ui header">Celled</h4>
  262. <p>A table may be divided each row into separate cells</p>
  263. <table class="ui celled table">
  264. <thead>
  265. <th>Name</th>
  266. <th>Status</th>
  267. <th>Notes</th>
  268. </thead>
  269. <tbody>
  270. <tr>
  271. <td>John</td>
  272. <td>Approved</td>
  273. <td>None</td>
  274. </tr>
  275. <tr>
  276. <td>Jamie</td>
  277. <td>Approved</td>
  278. <td>Requires call</td>
  279. </tr>
  280. <tr>
  281. <td>Jill</td>
  282. <td>Denied</td>
  283. <td>None</td>
  284. </tr>
  285. </tbody>
  286. <tfoot>
  287. <th>3 People</th>
  288. <th>2 Approved</th>
  289. <th></th>
  290. </tfoot>
  291. </table>
  292. </div>
  293. <div class="example">
  294. <h4 class="ui header">Basic</h4>
  295. <p>A table can reduce its complexity to increase readability.</p>
  296. <table class="ui basic table">
  297. <thead>
  298. <th>Name</th>
  299. <th>Status</th>
  300. <th>Notes</th>
  301. </thead>
  302. <tbody>
  303. <tr>
  304. <td>John</td>
  305. <td>Approved</td>
  306. <td>None</td>
  307. </tr>
  308. <tr>
  309. <td>Jamie</td>
  310. <td>Approved</td>
  311. <td>Requires call</td>
  312. </tr>
  313. <tr>
  314. <td>Jill</td>
  315. <td>Denied</td>
  316. <td>None</td>
  317. </tr>
  318. </tbody>
  319. </table>
  320. </div>
  321. <div class="example">
  322. <h4 class="ui header">Even Width</h4>
  323. <p>A table can specify its column count to divide its content evenly</p>
  324. <table class="ui five column table">
  325. <thead>
  326. <th>Name</th>
  327. <th>Status</th>
  328. <th>Age</th>
  329. <th>Gender</th>
  330. <th>Notes</th>
  331. </thead>
  332. <tbody>
  333. <tr>
  334. <td>John</td>
  335. <td>Approved</td>
  336. <td>22</td>
  337. <td>Male</td>
  338. <td>None</td>
  339. </tr>
  340. <tr>
  341. <td>Jamie</td>
  342. <td>Approved</td>
  343. <td>32</td>
  344. <td>Male</td>
  345. <td>Requires call</td>
  346. </tr>
  347. <tr>
  348. <td>Jill</td>
  349. <td>Denied</td>
  350. <td>22</td>
  351. <td>Female</td>
  352. <td>None</td>
  353. </tr>
  354. </tbody>
  355. <tfoot>
  356. <th>3 People</th>
  357. <th>2 Approved</th>
  358. <th></th>
  359. <th></th>
  360. <th></th>
  361. </tfoot>
  362. </table>
  363. </div>
  364. <div class="example">
  365. <h4 class="ui header">Column Width</h4>
  366. <p>A table can specify the width of individual columns independently.</p>
  367. <div class="ui ignored info message">Tables use a 16 column grid. This should be the total width of all elements in a column</div>
  368. <table class="ui table">
  369. <thead>
  370. <th class="ten wide">Name</th>
  371. <th class="six wide">Status</th>
  372. </thead>
  373. <tbody>
  374. <tr>
  375. <td>John</td>
  376. <td>Approved</td>
  377. </tr>
  378. <tr>
  379. <td>Jamie</td>
  380. <td>Approved</td>
  381. </tr>
  382. <tr>
  383. <td>Jill</td>
  384. <td>Denied</td>
  385. </tr>
  386. </tbody>
  387. <tfoot>
  388. <th>3 People</th>
  389. <th>2 Approved</th>
  390. </tfoot>
  391. </table>
  392. </div>
  393. <div class="example">
  394. <h4 class="ui header">Collapsing</h4>
  395. <p>By default tables take the size of their container. A collapsing takes up only as much space as its rows.</p>
  396. <table class="ui collapsing table">
  397. <thead>
  398. <th>Name</th>
  399. <th>Status</th>
  400. <th>Notes</th>
  401. </thead>
  402. <tbody>
  403. <tr>
  404. <td>John</td>
  405. <td>Approved</td>
  406. <td>None</td>
  407. </tr>
  408. <tr>
  409. <td>Jamie</td>
  410. <td>Approved</td>
  411. <td>Requires call</td>
  412. </tr>
  413. <tr>
  414. <td>Jill</td>
  415. <td>Denied</td>
  416. <td>None</td>
  417. </tr>
  418. </tbody>
  419. <tfoot>
  420. <th>3 People</th>
  421. <th>2 Approved</th>
  422. <th></th>
  423. </tfoot>
  424. </table>
  425. </div>
  426. <div class="example">
  427. <h4 class="ui header">Inverted</h4>
  428. <p>A tables colors can be inverted</p>
  429. <table class="ui inverted table">
  430. <thead>
  431. <th>Name</th>
  432. <th>Status</th>
  433. <th>Notes</th>
  434. </thead>
  435. <tbody>
  436. <tr>
  437. <td>John</td>
  438. <td>Approved</td>
  439. <td>None</td>
  440. </tr>
  441. <tr>
  442. <td>Jamie</td>
  443. <td>Approved</td>
  444. <td>Requires call</td>
  445. </tr>
  446. <tr>
  447. <td>Jill</td>
  448. <td>Denied</td>
  449. <td>None</td>
  450. </tr>
  451. </tbody>
  452. <tfoot>
  453. <th>3 People</th>
  454. <th>2 Approved</th>
  455. <th></th>
  456. </tfoot>
  457. </table>
  458. </div>
  459. <div class="another example">
  460. <table class="ui inverted red table">
  461. <thead>
  462. <th>Name</th>
  463. <th>Status</th>
  464. <th>Notes</th>
  465. </thead>
  466. <tbody>
  467. <tr>
  468. <td>John</td>
  469. <td>Approved</td>
  470. <td>None</td>
  471. </tr>
  472. <tr>
  473. <td>Jamie</td>
  474. <td>Approved</td>
  475. <td>Requires call</td>
  476. </tr>
  477. <tr>
  478. <td>Jill</td>
  479. <td>Denied</td>
  480. <td>None</td>
  481. </tr>
  482. </tbody>
  483. <tfoot>
  484. <th>3 People</th>
  485. <th>2 Approved</th>
  486. <th></th>
  487. </tfoot>
  488. </table>
  489. </div>
  490. <div class="example">
  491. <h4 class="ui header">Definition</h4>
  492. <p>A table may be formatted specifically to provide definitions</p>
  493. <table class="ui definition table">
  494. <thead>
  495. <th>Behavior</th>
  496. <th>Arguments</th>
  497. <th>Description</th>
  498. </thead>
  499. <tbody>
  500. <tr>
  501. <td>reset rating</td>
  502. <td>None</td>
  503. <td>Resets rating to default value</td>
  504. </tr>
  505. <tr>
  506. <td>set rating</td>
  507. <td>rating (integer)</td>
  508. <td>Sets the current star rating to specified value</td>
  509. </tr>
  510. </table>
  511. </div>
  512. <div class="example">
  513. <h4 class="ui header">Sortable</h4>
  514. <p>A table may allow a user to sort contents by clicking on a table header.</p>
  515. <div class="ui warning message">Adding a classname of <code>ascending</code> or <code>descending</code> to the <code>th</code> will show the user the direction of sort. This example uses a modified version of the kylefox's <a href="https://github.com/kylefox/jquery-tablesort">tablesort plugin</a> to provide the proper class names.
  516. </div>
  517. <table class="ui sortable table">
  518. <thead>
  519. <th>Name</th>
  520. <th>Status</th>
  521. <th>Notes</th>
  522. </thead>
  523. <tbody>
  524. <tr>
  525. <td>John</td>
  526. <td>No Action</td>
  527. <td>None</td>
  528. </tr>
  529. <tr>
  530. <td>Jamie</td>
  531. <td class="positive">Approved</td>
  532. <td class="warning">Requires call</td>
  533. </tr>
  534. <tr>
  535. <td>Jill</td>
  536. <td class="negative">Denied</td>
  537. <td>None</td>
  538. </tr>
  539. </tbody>
  540. <tfoot>
  541. <th>3 People</th>
  542. <th>2 Approved</th>
  543. <th></th>
  544. </tfoot>
  545. </table>
  546. </div>
  547. <div class="example">
  548. <h4 class="ui header">Padded</h4>
  549. <p>A table may sometimes need to be more padded for legibility</p>
  550. <table class="ui padded table">
  551. <thead>
  552. <th>Name</th>
  553. <th>Status</th>
  554. <th>Notes</th>
  555. </thead>
  556. <tbody>
  557. <tr>
  558. <td>John</td>
  559. <td>Approved</td>
  560. <td>He is a very nice guy and I enjoyed talking to him on the telephone. I hope we get to talk again.</td>
  561. </tr>
  562. <tr>
  563. <td>Jamie</td>
  564. <td>Approved</td>
  565. <td>Jamie was not interested in purchasing our product.</td>
  566. </tr>
  567. </tbody>
  568. </table>
  569. </div>
  570. <div class="example">
  571. <h4 class="ui header">Compact</h4>
  572. <p>A table may sometimes need to be more compact to make more rows visible at a time</p>
  573. <table class="ui compact table">
  574. <thead>
  575. <th>Name</th>
  576. <th>Status</th>
  577. <th>Notes</th>
  578. </thead>
  579. <tbody>
  580. <tr>
  581. <td>John</td>
  582. <td>Approved</td>
  583. <td>None</td>
  584. </tr>
  585. <tr>
  586. <td>Jamie</td>
  587. <td>Approved</td>
  588. <td>Requires call</td>
  589. </tr>
  590. <tr>
  591. <td>John</td>
  592. <td>Approved</td>
  593. <td>None</td>
  594. </tr>
  595. <tr>
  596. <td>Jamie</td>
  597. <td>Approved</td>
  598. <td>Requires call</td>
  599. </tr>
  600. <tr>
  601. <td>John</td>
  602. <td>Approved</td>
  603. <td>None</td>
  604. </tr>
  605. <tr>
  606. <td>Jamie</td>
  607. <td>Approved</td>
  608. <td>Requires call</td>
  609. </tr>
  610. <tr>
  611. <td>John</td>
  612. <td>Approved</td>
  613. <td>None</td>
  614. </tr>
  615. <tr>
  616. <td>Jamie</td>
  617. <td>Approved</td>
  618. <td>Requires call</td>
  619. </tr>
  620. </tbody>
  621. </table>
  622. </div>
  623. <div class="example">
  624. <h4 class="ui header">Size</h4>
  625. <p>A table can also be small or large</p>
  626. <table class="ui small table">
  627. <thead>
  628. <th>Name</th>
  629. <th>Status</th>
  630. <th>Notes</th>
  631. </thead>
  632. <tbody>
  633. <tr>
  634. <td>John</td>
  635. <td>Approved</td>
  636. <td>None</td>
  637. </tr>
  638. <tr>
  639. <td>Jamie</td>
  640. <td>Approved</td>
  641. <td>Requires call</td>
  642. </tr>
  643. <tr>
  644. <td>Jill</td>
  645. <td>Denied</td>
  646. <td>None</td>
  647. </tr>
  648. </tbody>
  649. <tfoot>
  650. <th>3 People</th>
  651. <th>2 Approved</th>
  652. <th></th>
  653. </tfoot>
  654. </table>
  655. </div>
  656. <div class="another example">
  657. <table class="ui large table">
  658. <thead>
  659. <th>Name</th>
  660. <th>Status</th>
  661. <th>Notes</th>
  662. </thead>
  663. <tbody>
  664. <tr>
  665. <td>John</td>
  666. <td>Approved</td>
  667. <td>None</td>
  668. </tr>
  669. <tr>
  670. <td>Jamie</td>
  671. <td>Approved</td>
  672. <td>Requires call</td>
  673. </tr>
  674. <tr>
  675. <td>Jill</td>
  676. <td>Denied</td>
  677. <td>None</td>
  678. </tr>
  679. </tbody>
  680. <tfoot>
  681. <th>3 People</th>
  682. <th>2 Approved</th>
  683. <th></th>
  684. </tfoot>
  685. </table>
  686. </div>
  687. </div>