In your _quarto.yml file or document’s YAML header, add group-html-cell-outputs to filters:
filters:- group-html-cell-outputs
When this filter is used with the default configuration, all outputs of a cell are automatically wrapped in a shared parent div with the cell-output-container class. Some default styles are applied to cell-output-container to adjust padding and prevent each child output element from having its own scrollbar so that the output container looks like a single output block.
Here is an example with long outputs:
import sysfor i inrange(0, 3):print(f"Output stdout {i} "*10)for i inrange(0, 3):print(f"Output stderr {i} "*10, file=sys.stderr)
Without the filter, the standard and error outputs would have had their own scrollbars. Now, they share a single scrollbar.
Additional styles can be applied by targeting .cell-output-container with CSS, or by overriding the classes applied to the container div (see default-container-classes and output-container-classes).