adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
13.04k stars 1.13k forks source link

Ability to set `colSpan` for `Cell` #5862

Open jussirantala opened 9 months ago

jussirantala commented 9 months ago

Provide a general summary of the feature here

It would be very useful to be able to set colSpan for the td element rendered by Cell.

It is used to make a cell fill more than one column for special table layouts.

๐Ÿค” Expected Behavior?

colSpan prop is in Cell prop types and the prop is passed to td.

๐Ÿ˜ฏ Current Behavior

colSpan prop is not passed to td.

๐Ÿ’ Possible Solution

Pass colSpan to td. I tried to hack this by modifying DOM directly and it worked.

๐Ÿ”ฆ Context

We would use it for displaying a error message inside the table. It should be horizontally centered and fill all the columns.

๐Ÿ’ป Examples

No response

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

reidbarber commented 9 months ago

Looks like a duplicate of https://github.com/adobe/react-spectrum/issues/5334

jussirantala commented 9 months ago

renderEmptyState prop of TableBody cannot be used because it doesn't let you set a class name for the tr or td generated and we need to have a classname for them (cannot style with parent styles).