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
As of this writing, kable %>% row_spec(row = 0, ...) modifies the header of the table, but if the header has multiple rows (via add_header_above()), the changes are applied to the last (bottommost) header row, and there appears to be no way to address the others.
Prior to 989d6dc, it was (serendipitously, I believe) possible to affect the last-but-one row with row = -1, but this no longer works. This could serve as a convention for addressing the rows (i.e., 0 for the bottommost header, -1 for the one above it, -2 for the one above that one, etc.), though it could clash with R's indexing.
To Reproduce
In the following, only the second header row is bolded:
I think a reasonable approach here would be to add another argument, something like header = FALSE, which if set to TRUE would mean the row indexing applied to the header instead of the body of the table.
I don't know what should happen with row = 0. If header = TRUE that should probably give an error. If header = FALSE, should some sort of back-compatibility be kept, or should that also be an error?
Since 0 is rarely used in R indexing, there is a strong argument for keeping it around as a special case for backwards compatibility. (Indeed, the fix that removed -1 broke some of my manuscripts.)
That having been said row_spec() never followed R's indexing semantics in the first place. For example, it does not accept logical vectors, and even after 989d6dc, a row = -1 with extra_latex_after= attempts to insert the code before the table start or thereabout, not after each table row but the first.
Describe the bug
As of this writing,
kable %>% row_spec(row = 0, ...)
modifies the header of the table, but if the header has multiple rows (viaadd_header_above()
), the changes are applied to the last (bottommost) header row, and there appears to be no way to address the others.Prior to 989d6dc, it was (serendipitously, I believe) possible to affect the last-but-one row with
row = -1
, but this no longer works. This could serve as a convention for addressing the rows (i.e., 0 for the bottommost header, -1 for the one above it, -2 for the one above that one, etc.), though it could clash with R's indexing.To Reproduce
In the following, only the second header row is bolded:
The text was updated successfully, but these errors were encountered: