Table Width
-
Hi
How can I change the width of the table? It’s currently wider than the text above and below the table.
Thanks
Katie
-
Hi,
thanks for your post, and sorry for the trouble.
Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!
Regards,
Tobiashttp://katiejanecollins.com/wp-admin/post.php
It’s not a live post yet – so hopefully you can see the link as it’s on “preview” mode!
Thanks
KatieHi Katie,
no, sorry, that link won’t work. It has to be a published post/page, as a non-logged-in user can not view the “Edit” screen of a post or its preview.
Regards,
Tobiashttp://katiejanecollins.com/fruit-infused-water
I’ve randomly added it into an old post – see above.
Thanks.
Hi,
thanks! One reason for this might be that the use of the DataTables JS library is turned on, while its individual features are turned off.
Can you therefore please try again after turning off the “Use DataTables” checkbox on the “Edit” screen of this table?Regards,
TobiasHi,
It doesn’t seem to be making any difference.
Thanks
KatieHi Katie,
thanks! Now I see what’s happening. Basically, your theme is giving non-text items (like big images or tables) a bigger width than the text. It does so by adding a margin to the text paragraphs.
If you want, you can do the same to tables, by adding this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:.tablepress { max-width: 1024px; margin: 0 auto; }
Regards,
TobiasAh you’re a star, thank you!
Is there a way or reducing the row width too? And also changing the colour of the header bar?
Thanks
Hi,
“row width”? Isn’t that the same as the table width? Can you maybe clarify what you mean with that?
For the table head row background color, please see https://tablepress.org/faq/change-background-color-table-head-row/
Regards,
TobiasHi,
Sorry I should of said row height! (I.e. above and below the text – between each separation line).
Thanks
Hi,
ah, ok π To reduce that, you can reduce the padding (inner white space) in the table cells, e.g. with
.tablepress th, .tablepress td { padding: 4px; }
In my opinion, this is not really necessary for your tables, though, as it would only reduce readability.
Regards,
TobiasThank you!
Is there any way to center the text too?
Thanks
Hi,
sure, by e.g. extending that code to
.tablepress th, .tablepress td { padding: 4px; text-align: center; }
Regards,
TobiasThank you!!
Last but not least… is there a way to get separation lines in between each column?
Thanks
Hi,
another change to
.tablepress th, .tablepress td { padding: 4px; text-align: center; border: 1px solid #cccccc; }
should work, but similarly to narrow rows, they are seen to be reducing readability.
Regards,
Tobias
- The topic ‘Table Width’ is closed to new replies.