Skip to content

Vertical layout option (swap rows and columns) #123

@austinhoag

Description

@austinhoag

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions