You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/3.components/table.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,7 @@ Use the `columns` prop as an array of [ColumnDef](https://tanstack.com/table/lat
77
77
78
78
-`accessorKey`: [The key of the row object to use when extracting the value for the column.]{class="text-muted"}
79
79
-`header`: [The header to display for the column. If a string is passed, it can be used as a default for the column ID. If a function is passed, it will be passed a props object for the header and should return the rendered header value (the exact type depends on the adapter being used).]{class="text-muted"}
80
+
-`footer`: [The footer to display for the column. Works exactly like header, but is displayed under the table.]{class="text-muted"}
80
81
-`cell`: [The cell to display each row for the column. If a function is passed, it will be passed a props object for the cell and should return the rendered cell value (the exact type depends on the adapter being used).]{class="text-muted"}
81
82
-`meta`: [Extra properties for the column.]{class="text-muted"}
82
83
-`class`:
@@ -161,7 +162,7 @@ props:
161
162
162
163
### Sticky
163
164
164
-
Use the `sticky` prop to make the header sticky.
165
+
Use the `sticky` prop to make the header or footer sticky.
165
166
166
167
::component-code
167
168
---
@@ -172,6 +173,10 @@ ignore:
172
173
- class
173
174
external:
174
175
- data
176
+
items:
177
+
sticky:
178
+
- true
179
+
- false
175
180
props:
176
181
sticky: true
177
182
data:
@@ -372,6 +377,22 @@ class: '!p-0'
372
377
This example is similar as the Popover [with following cursor example](/components/popover#with-following-cursor) and uses a [`refDebounced`](https://vueuse.org/shared/refDebounced/#refdebounced) to prevent the Popover from opening and closing too quickly when moving the cursor from one row to another.
373
378
::
374
379
380
+
### With column footer :badge{label="Soon"class="align-text-top"}
381
+
382
+
You can add a `footer` property to the column definition to render a footer for the column.
383
+
384
+
::component-example
385
+
---
386
+
prettier: true
387
+
collapse: true
388
+
name: 'table-column-footer-example'
389
+
highlights:
390
+
- 94
391
+
- 108
392
+
class: '!p-0'
393
+
---
394
+
::
395
+
375
396
### With column sorting
376
397
377
398
You can update a column `header` to render a [Button](/components/button) component inside the `header` to toggle the sorting state using the TanStack Table [Sorting APIs](https://tanstack.com/table/latest/docs/api/features/sorting).
0 commit comments