zsusac/ReactHTMLTableToExcel

Add option to add class name when generating sheet file

vhfmag opened this issue · 1 comments

I'm using this component in a product for my company and, right now, I need to maintain two tables in a given time: one for display and another for exporting, since there are style and content differences between those.

So, for the sake of keeping the application DRY, I'd like to implement a feature where the component would receive a string property that would be added to the table as a class name immediately before exporting and removed right away.

What do you think?

Hi Victor,
I am trying to keep my component as dummy as possible. The idea is that component is receiving an HTML table element ID without knowing anything about table and data in that table. The only component's task is to transform given input (HTML table node) to .xls file. Doing this, component is very generic. Maybe better solution is to keep component dummy as it is, and to implement that you can pass a valid HTML table string instead of HTML table element ID. Doing so, you can alter your table class and pass it as a string to the component, and component would not need to alter input data. What do you think about my idea?