You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The footnotes generated at the bottom of a gtsummary table by e.g. tbl_summary() are left aligned by default. When using the tbl- prefix for cross-referencing the table caption, the footnotes become centered
Footnotes are left aligned when cross-referencing is used but I have to use additional formatting from package gt. This is the output from chunk tbl-example-3.
Actual behavior
Footnotes are left aligned when no cross-referencing is used (output from example-1), but when cross-referencing is used footnotes are centre aligned (output from tbl-example-2).
Your environment
IDE: RStudio/2024.12.0+467
macOS Sequoia 15.1
Quarto check output
Quarto 1.7.13
[✓] Checking environment information...
Quarto cache location: /Users/derekchiu/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.4.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.46.3: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.7.13
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (external install)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/derekchiu/Library/TinyTeX/bin/universal-darwin
Version: 2024
[✓] Checking Chrome Headless....................OK
Using: Chrome found on system
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Source: MacOS known location
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.13.1
Path: /opt/homebrew/opt/[email protected]/bin/python3.13
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking R installation...........OK
Version: 4.4.2
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Users/derekchiu/Library/R/arm64/4.4/library
- /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
knitr: 1.49
rmarkdown: 2.29
[✓] Checking Knitr engine render......OK
The text was updated successfully, but these errors were encountered:
Which is the default behavior for content in crossref element to be centered
It is not specific to table, but it will apply on it because no style specific to the table override this.
Other rows have specific styling applied to them by gt (e.g using gt_left class )
So the alignment in the first table is left by default for the footnote, but this is inherit default from body. Which that the table content alignment does not seem to be protected against some global default
So if gtsummary wants to apply so default alignment, it should probably apply some table inline styling. I don't know if this is gt or gtsummary
it works because some inline style are now set on the footnote
<tdcolspan="2" class="gt_footnote" style="text-align: left;"><spanclass="gt_footnote_marks" style="white-space:nowrap;font-style:italic;font-weight:normal;line-height:0;"><sup>1</sup></span> Median (Q1, Q3); n (%)</td>
and so the .quarto-figure-center rule does not apply to it.
To sump, I don't think this is an issue to handle in Quarto directly, but something in gtsummary or gt to adapt to prevent external CSS to modify a default they expect maybe.
I can confirm this is gt. Here is a reprex with default gt
---title: "Untitled"execute:
echo: falsekeep-md: true---```{r}library(gt)``````{r}#| label: gt_tabgt::films[1:5, 1:2] |> gt() |> tab_footnote(footnote = "A footnote")```
::: {#tbl-gt}
```{r}#| label: gt_tab```
Same gt table as above but cross referencable
:::
See @tbl-gt
@rich-iannone I think this is something we could improve in gt. It seems tab_footnote() default is not protected against external CSS applying on wrapper element.
Bug description
The footnotes generated at the bottom of a
gtsummary
table by e.g.tbl_summary()
are left aligned by default. When using thetbl-
prefix for cross-referencing the table caption, the footnotes become centeredSteps to reproduce
Expected behavior
Footnotes are left aligned when cross-referencing is used but I have to use additional formatting from package
gt
. This is the output from chunktbl-example-3
.Actual behavior
Footnotes are left aligned when no cross-referencing is used (output from
example-1
), but when cross-referencing is used footnotes are centre aligned (output fromtbl-example-2
).Your environment
Quarto check output
The text was updated successfully, but these errors were encountered: