Displaying pandas dataframes as HTML tables in documents with both R and Python code chunks #10460
-
DescriptionI would like pandas dataframes to be displayed as they are displayed in jupyterlab/vscode notebooks (richly rendered tables where the width is restricted based on the number of characters in each column): When I try to display pandas dataframe in quarto, it extends to the full with of the div instead: Further complicating the issue is that my document mixes R and Python code, and when I do this the pandas dataframe is no longer rendered as an HTML table at all (which could be related to rstudio/reticulate#1474): Is there currently any way to display pandas dataframes as width restricted HTML tables in documents that mix R and Py without setting the width and style of each one of them and converting them to markdown individually? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Unfortunately, screenshots of code are unusable in addition to be inaccessible as there are not alternative text. Use For more help, please could you share a small self-contained "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? The goal is to make it as easy as possible for us to recreate your problem so that we can fix it: please help us help you! Thanks. You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.
Additionally and if not already given, please share the output of |
Beta Was this translation helpful? Give feedback.
-
FYI |
Beta Was this translation helpful? Give feedback.
You can overwrite in several ways: