I have some tables with lots of columns that I need to display. This does not fit nicely in the browser so I have used some javascript to swap rows and columns to make the display more manageable. However, this is fiddly and destroys the column_html_attrs among other undesired effects. It would be great if there was a native flask_table.Table() class attribute to swap rows and columns such that the column names could be in the left-most column and the row data could be displayed in columns rather than rows.
Here is a basic example. My real example has many more columns:
Original flask table:
| username |
age |
sex |
| user1 |
20 |
F |
| user2 |
22 |
M |
| user3 |
30 |
F |
Desired vertical layout table:
| username |
user1 |
user2 |
user3 |
| age |
20 |
22 |
30 |
| sex |
F |
M |
F |
I have some tables with lots of columns that I need to display. This does not fit nicely in the browser so I have used some javascript to swap rows and columns to make the display more manageable. However, this is fiddly and destroys the
column_html_attrsamong other undesired effects. It would be great if there was a native flask_table.Table() class attribute to swap rows and columns such that the column names could be in the left-most column and the row data could be displayed in columns rather than rows.Here is a basic example. My real example has many more columns:
Original flask table:
Desired vertical layout table: