-
Notifications
You must be signed in to change notification settings - Fork 335
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
Quarto Overrides Huxtable Styling With Bootstrap Theming #7187
Comments
For reference the issue on huxtable side: hughjonesd/huxtable#248 What happens is that Quarto process HTML tables since 1.3 (https://quarto.org/docs/authoring/tables.html#html-tables). Part of the processing will be to add the bootstrap class for tables (https://quarto.org/docs/authoring/tables.html#using-bootstrap-classes). For computation table, we use Currently, there is no way to modify this but this is tracked at Also Quarto tables processing can opt-out using an attribute on the table, but huxtable would need to allow to set this from a function argument (like gt) or allowing to add arbitrary attributes to Hope it helps |
Thanks for the report! This is more or less "working as intended": quarto does currently inject its table processing on any well-formed tables it sees in the HTML. We do this precisely so that if users change quarto themes, table styling is appropriately followed. Of course, this is unfortunate in this case, because you are -- totally reasonably! -- trying to get How to fix itQuarto will disable all of its table processing if it sees Note: I would like to help In addition, quarto should have an option to disable this processing at the document or project level, and we haven't done that yet. Finally, if you're willing to use a pre-release version of quarto, you can hack your way around this by adding a filter like so:
And the lua file is this: function RawBlock(node)
if node.format == "html" then
node.text = node.text:gsub("<table class=\"huxtable\"", "<table class=\"huxtable\" data-quarto-disable-processing=\"true\" ")
end
return node
end This is a pretty bad hack, but it should work for you in the meantime. |
Oh awesome, thanks so much for the information you guys! |
Huxtable author here. Thanks, this is very helpful. My thought is to unconditionally add the attribute... if you're using huxtable, you probably want to override the quarto styling, I guess? Is this just an HTML-specific issue? Or does it affect other formats? |
Granted I am but n = 1, but I agree that if you're using huxtable, you probably do want to override quarto styling. For the use case I gave in the example, it is specific to HTML. P.S. Huxtable is so awesome! So glad it exists, thank you. |
Currently, we look at I'll note that Finally, this work we do assumes that the tables being generated are valid HTML table elements. (I haven't tested |
Hi - it should now be possible to use a number of different approaches from the quarto side. See:
You can either add Thanks for the report again. |
Just to double check, can I also simply add |
For reference, hughjonesd/huxtable#248 has been solved in huxtable also. By default it will add the specific attribute to disable processing, but there is also a new option that you can set in R so that huxtable does not add the attributes.
@hughjonesd about this part of the table processing, this is documented here (https://quarto.org/docs/authoring/tables.html#html-tables). In a raw HTML table, you have a way to mark some content as "to-be-processed" by Quarto so that it is resolved as standard markdown. Main example is indeed adding some citation in a table. Just wanted to add this precision in case it wasn't clear which other adjustment could be done on the R package side. |
Not sure if this is more of a Quarto or huxtable question. It is currently an open issue at huxtable, and at the request of the maintainer over there, I am reporting it here also .
Sadly, the new Quarto (>= 1.3) undoes some of huxtable formatting in favor of Quarto's bootstrapping table theming. I have tried for html format but not PDF. Here's an example:
Created on 2023-10-09 with reprex v2.0.2
In the resulting html file, striping and probably other stuff I'm not noticing are changed, but so far I just notice striping. The expected output is for the table to resemble the theme_article() styling as shown here i.e., bold headers, no stripes.
This issue was noted in this stackoverflow question, but I found the solution unsatisfactory as it seems to break Quarto's tbl-cap: setting, at least for me.
System details
huxtable Version ‘5.5.2’
R Version 4.3.1 (2023-06-16)
Quarto Version 1.3
RStudio Version 2023.06.1+524 (2023.06.1+524)
The text was updated successfully, but these errors were encountered: