Skip to content
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

layout/styling issue. #333

Open
tomnobelsAM opened this issue Nov 5, 2024 · 0 comments
Open

layout/styling issue. #333

tomnobelsAM opened this issue Nov 5, 2024 · 0 comments

Comments

@tomnobelsAM
Copy link

Referring to this : I am confused about the possibilities for styling/layout. Suppose I want a table with 3 columns at the left side of the container.
When I use the width:xx/ it is right aligned
I see table-layout: auto ? Are there other possibilities, can I play with the margin parameter ?
I even once produced a table where the header names were not aligned with the data itself and I don't understand why.
So I think i am missing some knowledge. I search in the Datatable documentation but it's not clear to me.

The style argument
The show function has a style argument that determines the style for that particular table.

The default value for style is "table-layout:auto;width:auto;margin:auto;caption-side:bottom". Without width:auto, tables with few columns are stretched to fit the container width. Using margin:auto makes non-wide tables centered.

Position and width
You can set a specific width or position for a table using with the style argument of the show function:

show(df_small, style="table-layout:auto;width:50%;float:right")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant