Home › Forums › Support › Align Table Text to Center This topic has 5 replies, 2 voices, and was last updated 3 years, 10 months ago by David. Viewing 6 posts - 1 through 6 (of 6 total) Author Posts June 4, 2020 at 10:51 pm #1315043 Hendry Hello, i am having trouble in aligning my custom html table text to be centered. i tried this css: table,th,td,caption{text-align:center} but it makes my table text that i create with wordpress table element become centered also. is there any css can i use so only my the table with class element aligned center? June 5, 2020 at 4:52 am #1315362 DavidStaff Customer Support Hi there, you can add a class to your HTML and target that eg. <table class="custom-table"> <!-- Rest of table code --> </table> then you should be able to target that class: .custom-table { text-align: center; } June 5, 2020 at 5:20 am #1315383 Hendry i tried this code before with class .dounkey-table-center, but it still does not work June 5, 2020 at 6:10 am #1315437 DavidStaff Customer Support Try this: table.dounkey-table-center, table.dounkey-table-center th, table.dounkey-table-center td, table.dounkey-table-center caption { text-align: center; } June 5, 2020 at 7:19 am #1315512 Hendry Thank you, it works June 5, 2020 at 7:36 am #1315534 DavidStaff Customer Support You’re welcome Author Posts Viewing 6 posts - 1 through 6 (of 6 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In