From 56bb43fd1715a3d769b423b9f83f53c0b92ecebd Mon Sep 17 00:00:00 2001 From: "Christopher (Cris) Fuhrman" Date: Sun, 19 Jan 2025 19:09:33 -0500 Subject: [PATCH] Give an example with tbl-pos="t" that also needs layout-ncol="1" to work in PDF See the comment at https://github.com/quarto-dev/quarto-cli/discussions/4849#discussioncomment-11622517 I'm suggesting an example be added to the documentation, as it took me a long time to figure this out! --- docs/authoring/cross-references-divs.qmd | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/authoring/cross-references-divs.qmd b/docs/authoring/cross-references-divs.qmd index 504baf931a..7dee39fd95 100644 --- a/docs/authoring/cross-references-divs.qmd +++ b/docs/authoring/cross-references-divs.qmd @@ -136,6 +136,23 @@ In the above example, you can reference the figure with `@fig-line-plot`, but no {{< include _cross-reference-divs-table.qmd >}} + +In PDF output, if you want to specify table float placement (e.g., T for top), be sure to add both `tbl-pos="t"` and `layout-ncol="1"` in the div: + +````markdown +::: {#tbl-rubric tbl-pos="t" layout-ncol="1"} + +| Criterion | Meets Expectations (10) | Needs Improvement (5) | +|-------------------|-------------------------|------------------------| +| **Understanding** | Clear understanding. | Unclear understanding. | +| **Completion** | Task completed. | Task incomplete. | + +: Sample grading rubric + +::: + +```` + If the table is produced by an executable code cell, put the cell inside the div as content, e.g: ````markdown