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.

865 lines
20 KiB

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