reactablefmtr icon indicating copy to clipboard operation
reactablefmtr copied to clipboard

Option to Export Code for use in a Handcrafted Web Page/ Site

Open ChrisWoodsSays opened this issue 2 years ago • 3 comments

Hi Kyle,

reactable and reactablefmtr are great.

I need to include a table I've built using them via R in a webpages that have not been created in R via an RMD etc.

Ideally, i'd like to apply the javascript and CSS to a Div with an ID that is on one of those pages.

I've been looking at the generated code and suspect I could do this, but probably with a degree of copying out the relevant bits. I can see that it already creates the Div with the supplied ID and applies the table to it. So I'm some way there already.

I'm just trying to see if I can extract what I need (javascript and CSS?) relatively straightforwardly.

Thanks,

Chris.

ChrisWoodsSays avatar Mar 19 '22 18:03 ChrisWoodsSays

Hi Chris, I'm not sure if I'm understanding your question exactly. It sounds like you want to see the contents of the JS/CSS code from a reactable table that uses JS/CSS for styling purposes? Is this a table that you built or another table that's already been built?

kcuilla avatar Mar 19 '22 19:03 kcuilla

Hi Kyle. It's a table I've built in reactable with reactablefmtr.

I'm building a simple but styled site (actually a sub domain of a broader site, so it's needs common styling etc).

So ideally, id like to have some simple divs with IDs and then have a separate file(s) with the table code, the js and CSS in it.

ChrisWoodsSays avatar Mar 19 '22 20:03 ChrisWoodsSays

Got it, thanks for clarifying for me. So ideally, you would want any underlying JS/CSS code used in the reactablefmtr functions to be outputted so that you can put them in a separate file? Unfortunately, I'm not sure there is an easy way of doing that other than looking at the underlying functions and seeing what JS/CSS styles are being applied.

kcuilla avatar Mar 19 '22 21:03 kcuilla