posit-dev / great-tables

Make awesome display tables using Python.
https://posit-dev.github.io/great-tables/
MIT License
1.44k stars 50 forks source link

Improve HTML representation of tables #233

Closed rich-iannone closed 3 months ago

rich-iannone commented 4 months ago

This PR adds the option to generate a complete HTML page around the emitted table fragment. And this vastly improves the printing of a table in the vscode jupyter notebook environment by raising the specificity of the tables CSS rules (in the <style> block). We also detect whether rendering is occurring in a Quarto document and, in that case, the compiled CSS is kept as is.

Fixes: https://github.com/posit-dev/great-tables/issues/228

machow commented 3 months ago

From pairing w/ Rich, I've consolidated the code for inferring the IDE environment into the _render.py submodule, and hard-coded the IDE environment specific flags there.

(Rich mentioned he'll pick it up from here!)

rich-iannone commented 3 months ago

@isabelizimm @machow thank you for your help with this PR! Going to merge now but there should be many more improvements in this particular area down the road.