react-bootstrap-table icon indicating copy to clipboard operation
react-bootstrap-table copied to clipboard

custom data attribute to table headers or table cells

Open hctslm opened this issue 9 years ago • 5 comments

I want add a data-text="My own value" attribute to each cell or header for my reference to add some functionality.

How can I save my temporary data in table cell or headers, which can be used later

Thanks

hctslm avatar Dec 08 '16 10:12 hctslm

hi @hctslm, You can use dataFormat to custom your column, but we cant apply custom attribute on header column. Anyway, why to want to attach some attribute on header column? what's your requirement??

AllenFang avatar Dec 08 '16 16:12 AllenFang

@AllenFang: I think @hctslm meant attribute on TD directly. I would also like to be able to set specific attributes to TD like colspan and eventually decide whether some TD should be rendered at all.

Use case: I have four columns in table and in some rows I need to display just a message which could be easily done when one could define colspan on TD and not render the rest of TDs.

Is it possible to achieve this in react-bootstrap-table?

mauretanec avatar Jan 04 '17 12:01 mauretanec

@mauretanec, is not possible in react-bootstrap-table, but I think I can try to support this feature(Add custom attribute on TD)

AllenFang avatar Jan 05 '17 01:01 AllenFang

@hctslm, released on v2.8.3 and check this example.

AllenFang avatar Jan 07 '17 08:01 AllenFang

@AllenFang - how do we do this for the header column so we can add col="scope" to it for a11y

paypay43 avatar May 09 '20 00:05 paypay43