[Feature Request] data-table: ability to group headers/columns
See original GitHub issueProblem to solve
It is currently not possible to group table headers / columns so that related headers can have a common title above them.
There are various use cases across different industries for being able to create column groups, especially when doing multi-dimension comparisons (I can provide real-world examples if needed).
Proposed solution
From a props perspective, I think one could augment the current :headers
prop to accept nested column definitions. Something along these lines:
[
{ text: 'Total', value: 'yearlyTotal', align: 'left' },
{
text: 'Q1 2019',
align: 'center',
headers: [
{ text: 'Travel', value: 'travelQ1' },
{ text: 'Food', value: 'foodQ1' },
{ text: 'Equipment', value: 'equipmentQ1' }
]
},
{
{
text: 'Q2 2019',
align: 'center',
headers: [
{ text: 'Travel', value: 'travelQ2' },
{ text: 'Food', value: 'foodQ2' },
{ text: 'Equipment', value: 'equipmentQ2' }
]
}
]
Column nesting / grouping to continue recursively (meaning the developer could create as much grouping and sub-groupings as they need). Column groups would not be sortable nor filtrable, only individual columns.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Rowgroup with dynamic source and making group header a link
Hello, I am trying to figure out if it is possible to make a rowgroup header a link when the rowgroups are dynamic....
Read more >Configuring Columns - DataTable - Documentation - Webix
Webix Documentation: Learn how you can configure columns of the DataTable widget: add or delete columns dynamically, group columns, use styles, etc.
Read more >Introduction to data.table
table syntax, its general form, how to subset rows, select and compute on columns, and perform aggregations by group. Familiarity with data.
Read more >lightning-datatable - documentation - Salesforce Developers
If hideDefaultActions is set to true on a column that has custom header actions, the "Clip text" and "Wrap text" actions are removed...
Read more >Append queries - Power Query | Microsoft Learn
If one of the appended tables doesn't have a column header from other tables, the resulting table shows null values in the respective...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Using this info, it turns out you can simply implement your own categories line above the default headers if you just add
<thead>
in the slot template. Leaving out the<thead>
, as you said, puts it underneath.yes, you have to manually set
hide-default-header