With quarto how can I right-left center align (justify) contents within a column in a two column display

Viewed 201

I have a two column display in quarto. What do I add to right-left center (justify) content within each of the columns? Here is the basic code:

---
title: "uncentered"
---

:::: {.columns}

::: {.column width="50%"}
content
x
content
:::

::: {.column width="50%"}
y
content
y
:::

::::

From the pandoc docs I see I can use align=center in beamer but I just want a basic html page.

1 Answers

If you want to tweak things in html, you can use css rules as a last resort.

Try this

---
title: "uncentered"
format: html
engine: knitr
---


```{css echo=FALSE}
.column {
text-align: center;
}
```


:::: {.columns}

::: {.column width="50%"}

content

x

content
:::

::: {.column width="50%"}

y

content

y
:::

::::

Also take note of that engine: knitr in yaml. Since Here the very first thing was used a css code, Quarto will try to render this file using jupyter engine. So I have specified engine: knitr just to be in a safe side.

Related