I'm not having success aligning text on multiple lines in Quarto. This is easy in Microsoft Word. Below is an image of what I want to produce with a Quarto doc rendered to a PDF:
Here's what I've tried so far in Quarto that has not been successful:
| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
| 12 | 12 | 12 | 12 |
| 123 | 123 | 123 | 123 |
| 1 | 1 | 1 | 1 |
I need to be able to align text similar to the image provided for company formatting, but I don't want to use Word because I need to be able to supply results of data analysis and calculations and want to avoid copy/paste.
I'm not familiar with CSS or other potential options, but open to any suggestions on how to align text in Quarto similar to the image. Thank you.
For pdf output flextable
works well.
data.frame
with the cellsflextable()
width()
s---
title: "text align"
format: pdf
editor: source
execute:
echo: false
---
```{r}
library(flextable)
library(tibble)
```
```{r}
df1 <-
tribble(~col1, ~col2,
"Client:", "Multi \n Line \n Text \n Here",
"Intended Users of The Report:", "One Line Text Here",
"Third Item:", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")
```
```{r}
flextable(df1) |>
delete_part("header") |>
border_remove() |>
width(1, 2.1) |>
width(2, 4) |>
valign(valign = "top")
```