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.

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