Closed andrewheiss closed 2 months ago
I'm trying to focus on tables 1 and 3 first, because the Quarto devs really want us to use the tbl-
prefix in table labels, so I'd rather encourage that supported workflow.
Looks like the second table inherits from this, but not the first:
.quarto-figure-center > figure > p, .quarto-figure-center > figure > div {
text-align: center;
}
When I un-check that line in Firefox Inspector, the alignment returns to correct.
Honestly, I have no clue why that is. Looking at the HTML, I feel that both should have the same inheritance, since the div structure is similar (identical?).
Do you see any difference in the HTML of those two tables?
Minimal example under the fold:
Ok cool, yeah, I'm not concerned about tables 2 and 4—they work as expected and just don't get handled by Quarto
There is a slight difference between the two tables here. Without group_tt()
, the auto-generated tinytable CSS class is applied to all the <td>
elements, as expected:
In the table with the groups, the "Apple" and "4" <td>
elements don't have a tinytable CSS class applied to them, so they inherit the centering from the parent container
Thanks for the investigation!
This is a tough one. The CSS classes are inserted dynamically via JS and an addEventListener
.
Note to self:
In this case, there are multiple event listeners, apply changes to the same cells, so there seems to be conflict. And the order of listeners appears to make a difference too.
Thanks again for the report. I believe this is fixed in main
.
Fixed!
(I think this is a regression, since it used to work fine in previous versions of {tinytable}, like back at 0.2)
Using {tinytable} v0.3.0.19 (and 0.3.0.22), the ability to align columns breaks when using grouped rows, but only when the table has a
tbl-*
label and gets processed with Quarto.Here's a reprex:
Table without groups with a
tbl-*
chunk name (see @tbl-testing-no-groups):Table without groups without a
tbl-*
chunk name (see table below):This is the broken table. Table with groups with a
tbl-*
chunk name (see @tbl-testing):Table with groups without a
tbl-*
chunk name (see table below):