vincentarelbundock / tinytable

Simple and Customizable Tables in `R`
https://vincentarelbundock.github.io/tinytable
GNU General Public License v3.0
211 stars 18 forks source link

Table footnotes are always centered in HTML tables rendered through Quarto #303

Closed andrewheiss closed 4 months ago

andrewheiss commented 4 months ago

(This is probably related to #297)

If a tinytable with footnotes is included in a Quarto chunk with a tbl-* label, the notes are centered in the rendered HTML instead of left-aligned

Here's a reprex:

---
title: "Table note"
---

```{r}
library(tinytable)
tbl <- data.frame(
  Person = c("Alice", "Bob", "Charlemagne"),
  Fruit = c("Apple", "Banana", "Cantaloupe"),
  Count = c(4, 238432, 32)
)
tbl |>
  tt(
    width = c(1/3, 1/3, 1/3),
    notes = list("a" = list(i = 1, j = 1, text = "A note"))
  ) |>
  style_tt(j = 1:3, align = "l")
#| label: tbl-testing
#| tbl-cap: A table

tbl |>
  tt(
    width = c(1/3, 1/3, 1/3),
    notes = list("a" = list(i = 1, j = 1, text = "A note"))
  ) |>
  style_tt(j = 1:3, align = "l")


The note is left-aligned in the first table; it is centered in the second table:

<img width="829" alt="image" src="https://github.com/vincentarelbundock/tinytable/assets/73663/5fb7bb0d-0f3b-4d93-aaf7-2e4ea0e0ddd6">

As with #297, the table footer is getting centered with some Quarto CSS:

![image](https://github.com/vincentarelbundock/tinytable/assets/73663/929853b5-0fcf-4928-ba0f-08502a5ccb7d)
vincentarelbundock commented 4 months ago

Thanks for the report. I believe this is fixed in 0.3.0.26

andrewheiss commented 4 months ago

It's fixed—thanks!