Hi,
thanks for your post, and sorry for the trouble.
This is indeed the expected behavior here. When the table width is reduced, the table is automatically centered. To change that, please try this extended CSS code:
.tablepress-id-34 {
width: 50% !important;
margin: 0 0 1em 0;
}
(The !important flag that you mention is only needed because your theme is also setting the width of tables to 100%.)
Regards,
Tobias
Hi you are amazing! May i seek your advice as to why the rest of my site also using tablepress doesnt have this auto-align to center effect when i reduce the table width? They still stick to the left.
Hi,
where exactly do you mean?
regt
Regards,
Tobias
Hi i mean i am doing the same thing over at my other websites that also use Tablepress. The table did not auto-align centre even if i set the width to 50%. Do you know why only certain website has this issue?
Hi,
This centering is the default behavior of TablePress and it’s on purpose (so it’s not actually an “issue” 🙂 ).
It’s possible that there’s already other CSS code on those other sites (maybe from previously added “Custom CSS” or maybe the theme) that is changing that to left-aligned.
If you post a link, I can try to find out why the behavior is different.
Regards,
Tobias