datatables in Jupyter notebook

datatables in Jupyter notebook

mwoutsmwouts Posts: 19Questions: 3Answers: 0

Hello,

Thanks for maintaining the datatables library, this is a great library !

My use case for DT is for quickly displaying tables with data coming from R or Python.

In R I was using the DT package from cran. But in Python DT was not yet available, so I wrote a prototype for displaying tables in notebooks with datatables. First results are available at https://mwouts.github.io/itables/ .

For now it works well, as long as the table does not have too many columns. Can I get your advice on how to improve the rendering of tables with more columns? Especially, I'd like to know
- how to get the autoWidth working? You will notice on the link above that the first table has all the columns of the same width, but the table would look nicer with adjusted widths.
- how can I get user specified widths working? Inside a Jupyter notebook they appear to work only under certain conditions, see the two examples at https://mwouts.github.io/itables/#Column-width

Looking forward to reading you,

Marc

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Try adding width="100%" to your <table> tag.

    how can I get user specified widths working?

    With the number of columns in the table it is likely that the browser is overruling your defined widths to try and fit all of the content in to the space available.

    Allan

This discussion has been closed.