-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(HTML) Indices are changed after cells are merged with rowspan
#355
Comments
Interesting. I think this may be HTML-specific. In LaTeX, all entries stay in the table and we use a In HTML, I believe that we "drop" cells, so indexing probably changes. This may require us to store a new S4 slot with information about spans, so that we can adjust indices appropriately. That's an interesting problem I had not considered before. Super busy at work these days, but I'll take a look when I find some time. Thanks for the report! |
rowspan
rowspan
MRE:
We wanted to highlight first column. Instead, the first cell in a row is always highlighted, since the actual first cell was deleted by rowspan. For complex HTML tables. So to fix that, an empty dummy column needs to be inserted, or any conditional highlighting needs to compensate indexing for this, |
This PR is a proof of concept to handle the Problems:
Orange works despite pkgload::load_all()
tt(head(iris)) |>
style_tt(j = 1, i = 1, rowspan = 2, colspan = 2) |>
style_tt(i = 1, color = "blue") |>
style_tt(j = 1, color = "orange", italic = TRUE)
save_tt("example.html", overwrite = TRUE) |
This could perhaps be emphasized in documentation because it took me quite a bit to understand what is going on.
style_tt(rowspan = ...)
to merge rowsstyle_tt(j = ... , i = which(...))
-- suddenly columns are styled (e.g., coloured) in weird ragged way.Switching order of operations doesn't help (likely they are evaluating lazily in a particular order)
This makes conditional styling together with rowspan essentially impossible (without adding a bunch of dummy column).
The text was updated successfully, but these errors were encountered: