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.

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