-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Html table export: Add of other attributes #6488
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
Comments
related is #3190 which proposes to do this with templates however, I think a possible solution is as follows. modify Then modify e.g.
and need to modify
lmk if you are up for this....It seems a much bigger change that it actually is, but it is necessary |
Currently, the HTMLFormatter methods take a 'tags' kwarg, IMHO that should be named 'attributes' instead (in order to match expected HTML/XML terminology). |
How about adding the scope attribute to the Thanks |
This could be done similar to #7338 , but I think in this case it may even be possible using non-trivial CSS selectors like table.dataframe tr:firstchild { color: red } Of course, that would not deal with hierarchical indices yet, so I am +1 on additional classes. |
Yeah, I tried that but results are bad with MultiIndex, so this is a no go. |
This is old, now addressed with Styler? |
yep closing |
The to_html method allows to specify a set of classes for table rendering
However, I would like to specify other attribute to the table markup
Typically I want to use the DataTables (table plug-in for jQuery) library, that requires another attribute for rendering table
Here is an example
https://datatables.net/release-datatables/examples/basic_init/multi_col_sort.html
In method write_result of class HTMLFormatter in pandas/core/format.py
there is this command that I would like to update with other attributes
I tweak it for my personal needs, and it looks like this.
But I would like to be more general.
I would like to give a dictionary to the to_html method that will expand and produce the line below.
Is it possible?
The text was updated successfully, but these errors were encountered: