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.

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