Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

expandable-tables.md 2.6KB

vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
vor 3 Jahren
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. ---
  2. layout: page
  3. title: Expandable Table Plugin
  4. ---
  5. The expandable table plugin provides simple functionality to create expandable tables.
  6. ##### Example Code
  7. ```html
  8. <table class="table table-bordered table-hover">
  9. <tbody>
  10. <tr data-widget="expandable-table" aria-expanded="false">
  11. <td>183</td>
  12. </tr>
  13. <tr class="expandable-body">
  14. <td>
  15. <p>
  16. <!-- YOUR EXPANDABLE TABLE BODY HERE -->
  17. </p>
  18. </td>
  19. </tr>
  20. <tr data-widget="expandable-table" aria-expanded="true">
  21. <td>219</td>
  22. </tr>
  23. <tr class="expandable-body">
  24. <td>
  25. <p>
  26. <!-- YOUR EXPANDABLE TABLE BODY HERE -->
  27. </p>
  28. </td>
  29. </tr>
  30. <tr data-widget="expandable-table" aria-expanded="true">
  31. <td>657</td>
  32. </tr>
  33. <tr class="expandable-body">
  34. <td>
  35. <p>
  36. <!-- YOUR EXPANDABLE TABLE BODY HERE -->
  37. </p>
  38. </td>
  39. </tr>
  40. </tbody>
  41. </table>
  42. ```
  43. {: .max-height-300}
  44. > ##### Tip!
  45. > You can control the default visibility with ` aria-expanded="false"`/` aria-expanded="true"` via the expandable table
  46. > header.
  47. > {: .quote-info}
  48. ##### Usage
  49. This plugin can be activated as a jQuery plugin or using the data api.
  50. ###### Data API
  51. {: .text-bold }
  52. Add `data-widget="expandable-table"` to a table row to activate the plugin and place a new table row below with
  53. the `.expandable-body`-class.
  54. ```html
  55. <tr data-widget="expandable-table" aria-expanded="true">
  56. <td>657</td>
  57. </tr>
  58. <tr class="expandable-body">
  59. <td>
  60. <p>
  61. </p>
  62. </td>
  63. </tr>
  64. ```
  65. > ##### Tip!
  66. > To get the correct slide up/down animation place a `div` or `p`-tag inside your expandable table body.
  67. > {: .quote-info}
  68. ###### jQuery
  69. {: .text-bold }
  70. The jQuery API provides more customizable options that allows the developer to toggle the visibilty state of one table
  71. row.
  72. ```js
  73. $('#expandable-table-header-row').ExpandableTable('toggleRow')
  74. ```
  75. ##### Methods
  76. {: .mt-4}
  77. |---
  78. | Method | Description
  79. |-|-
  80. |toggleRow | Toggles the state of the expandable table body between hidden and visible.
  81. {: .table .table-bordered .bg-light}
  82. Example: `$('#expandable-table-header-row').ExpandableTable('toggleRow')`
  83. ##### Events
  84. {: .mt-4}
  85. |---
  86. | Event Type | Description
  87. |-|-
  88. |expanded.lte.expandableTable | Triggered after a expandable table body is expanded.
  89. |collapsed.lte.expandableTable | Triggered after a expandable table body is collapsed.
  90. {: .table .table-bordered .bg-light}
  91. Example: `$('#expandable-table-header-row').on('expanded.lte.expandableTable', handleToggledEvent)`