Skip to content

Support for Multi-Row and Colspan Headers in UTable Component #3296

@Johnwjl

Description

@Johnwjl

Description

Description:
I am currently using the UTable component from Nuxt UI and have encountered a limitation regarding the customization of table headers. Specifically, I need to create a table with multi-row headers and the ability to merge columns using colspan. For example, the multi-row spanning column headers shown in the image.However, the current implementation of the UTable component does not seem to support this feature.
Image

Current Behavior:

The header property allows for custom content using the h function, but it is limited to single-column customization.
The available slots are primarily designed for single-column or specific row customization and do not support multi-column header customization.
Expected Behavior:

Ability to define headers that span multiple rows and columns.
Support for colspan and rowspan attributes in the header configuration to allow for more complex table layouts.
Enhanced slot functionality to support multi-column header customization.
Use Case:
This feature is essential for creating complex data tables where grouped headers are necessary for better data organization and presentation. It is particularly useful in scenarios where data needs to be categorized under broader headings.

Proposed Solution:

Introduce a mechanism in the UTable component to allow for multi-row and multi-column header definitions.
Provide examples and documentation on how to implement these features using the existing API or through new enhancements.
Consider expanding the slot functionality to support more complex header customizations.
Additional Context:

This feature is commonly supported in other table libraries and would greatly enhance the flexibility and usability of the UTable component in Nuxt UI.
Environment:

Nuxt UI version: [3.0.0-alpha.12]
Nuxt version: [^3.15.4]

Related Issues Link:
#1289 (comment)
#1651
#2053

Related Documentation Link:
https://ui3.nuxt.dev/components/table

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv3#1289

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions