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

Key not added to header class

Open n3ps opened this issue 7 years ago • 4 comments

Using the key as a workaround to style a column works, but only for <td> table cells.

Documentation say that it will also get applied to the <th> header cells.

n3ps avatar Jan 05 '18 16:01 n3ps

Could you give more details on what you trying to do, are you referring to cellClass, rowClass and headerClass settings?

agracio avatar Jan 05 '18 16:01 agracio

Using this value for columns: [{ key: 'amount' }]

Renders <td class="jsonCell jsonCell_amount" ...> for the cells but just <th class="jsonColumn" ...> for the header

n3ps avatar Jan 05 '18 17:01 n3ps

I did find a workaround through settings by passing headerClass a function (_, key) => key

n3ps avatar Jan 05 '18 17:01 n3ps

I think thats the only option, but you raise a good point. I will add this to my https://github.com/agracio/ts-react-json-table fork.

agracio avatar Jan 05 '18 17:01 agracio