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

Two Header Tables?

Open debuggeek opened this issue 7 years ago • 5 comments

Any thoughts on how this might be modified to support both a single row and a single column that are both table headers? I'm happy to help do this if I can, but didn't know if it was tried and abandoned for some reason

debuggeek avatar Apr 25 '18 02:04 debuggeek

Hi debuggek

Have you had a look at the column definitions prop:

https://github.com/arqex/react-json-table#column-definition

It has a cell attribute where you can throw your own component that might react to clicks or look like a header

arqex avatar Apr 25 '18 06:04 arqex

What I'm really trying to achieve is a table which has well defined rows and N headers based on the number of items in the JSON array, and believe me not my choice but have to match an existing table format :)

-Nick

On Wed, Apr 25, 2018 at 1:45 AM, Javier Marquez [email protected] wrote:

Hi debuggek

Have you had a look at the column definitions prop:

https://github.com/arqex/react-json-table#column-definition

It has a cell attribute where you can throw your our component that might react to clicks or look like a header

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/arqex/react-json-table/issues/24#issuecomment-384177856, or mute the thread https://github.com/notifications/unsubscribe-auth/AKpjEhfc7LlPmT2jLoLN_31gzrP6hgbsks5tsBuSgaJpZM4TishX .

debuggeek avatar Apr 25 '18 14:04 debuggeek

Do you mean something like this https://www.w3.org/WAI/tutorials/tables/irregular/ or this https://www.w3.org/WAI/tutorials/tables/multi-level/ ?

agracio avatar Apr 25 '18 14:04 agracio

I think I don't follow what we want to get. Can you give a simple json object that you would use with that table?

@agracio Maybe we can add some option to allow edit row, cell and headers html attributes and get this kind of complex table, but I think supporting colgroup is too much for this components, it tries to make tables simple, I would go with creating my own table component for something that specific, it will be much faster than adapt a generic component like react-json-table.

arqex avatar Apr 25 '18 14:04 arqex

I think we need more info on the actual problem, if it's reasonable perhaps it can be supported. I have added some extra options like header grouping to my implementation of this component https://github.com/agracio/ts-react-json-table

agracio avatar Apr 25 '18 14:04 agracio