Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Table): add rowClass to columns list #1632

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

galexrt
Copy link

@galexrt galexrt commented Apr 7, 2024

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This allows the columns list to specify a class to be set on the rows columns.

Implements the idea from my comment here: #527 (comment)

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

I could add more info to the documentation about this feature if wanted.

@@ -29,6 +29,7 @@ Use the `columns` prop to configure which columns to display. It's an array of o
- `sortable` - Whether the column is sortable. Defaults to `false`.
- `direction` - The sort direction to use on first click. Defaults to `asc`.
- `class` - The class to apply to the column cells.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the class field already dedicated to this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class field only seems to be applied to the <th> of the column, if I use block lg:hidden there it will only hide the header and not the data cells <td>.
I would prefer having a way to add a class from the columns list instead of having to modify the rows I pass into the Table component to set classes on data cells.

This allows the columns list to specify a class to be set on the rows
columns.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants