---
title: "side by side codeblocks and outputs"
filters:
- line-highlight
---
# `::::{.column-screen-insert}`
## Syntax
````default
::::{.columns .column-screen-insert .column-screen}
::: column
```python
print('left column')
```
:::
::: column
```python
print('right column')
```
:::
::::
````
## Example
:::: {.columns .column-screen-insert .column-screen}
::: column
<h2 style="text-align: center;">left column</h2>
```{python}
import plotly.express as px
df = px.data.iris() # iris is a pandas DataFrame
fig = px.scatter(df, x="sepal_width", y="sepal_length")
fig.show()
```
:::
::: column
<h2 style="text-align: center;">right column</h2>
```{python}
import plotly.express as px
data_canada = px.data.gapminder().query("country == 'Canada'")
fig = px.bar(data_canada, x='year', y='pop')
fig.show()
```
:::
::::
---
# `:::{layout-ncol='3'}`
## Syntax
````default
::::{.column-screen}
:::{layout-ncol="3"}
```python
print('a')
```
```python
print('b')
```
```python
print('c')
```
:::
::::
````
## Example
::::{.column-screen}
:::{layout-ncol="3"}
```{python}
print('a')
```
```{python}
print('b')
```
```{python}
print('c')
```
:::
::::
---
# `::::{.columns}` and `:::{.column width="30%"}`
## Syntax
````default
::::{.columns .column-screen}
:::{.column width="30%"}
```python
print('a')
```
:::
:::{.column width="40%"}
```python
print('b')
```
:::
:::{.column width="30%"}
```python
print('c')
```
:::
::::
````
## Example
:::: {.columns .column-screen}
::: {.column width="30%"}
```{python}
print('a')
```
:::
::: {.column width="40%"}
```{python}
print('b')
```
:::
::: {.column width="30%"}
```{python}
print('c')
```
:::
::::
---
# Ref
- https://stackoverflow.com/a/74544808/2559693
- https://github.com/quarto-dev/quarto-cli/issues/8179