Title: One table not centering
Last modified: August 30, 2016

---

# One table not centering

 *  Resolved [tchapman95](https://wordpress.org/support/users/tchapman95/)
 * (@tchapman95)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/one-table-not-centering/)
 * HI Tobias,
 * On this page, my second table is not centering correctly:
    [http://texanscap.com/team-salary-cap-tables/2015-salary-cap-table/](http://texanscap.com/team-salary-cap-tables/2015-salary-cap-table/)
 * I using the code & CSS Class
 *     ```
       .tablepress-table-centered {
       	width: auto;
       	margin: 0 auto 1em;
       }
       ```
   
 * All my other tables that I use this CSS class on center correctly. But for some
   reason this one table will not center correctly. Any ideas?
 * [https://wordpress.org/plugins/tablepress/](https://wordpress.org/plugins/tablepress/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/one-table-not-centering/#post-6308473)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * The reason for this is that this table is using the features of the DataTables
   JS library. Due to that, some more explicit code is necessary:
 *     ```
       .dataTables_wrapper .tablepress-table-centered {
       	width: auto;
       	margin: 0 auto 1em !important;
       }
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [tchapman95](https://wordpress.org/support/users/tchapman95/)
 * (@tchapman95)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/one-table-not-centering/#post-6308484)
 * Thanks Tobias. Does this code go into the Plug-In options or the CSS Class area?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/one-table-not-centering/#post-6308485)
 * Hi,
 * this goes into the “Custom CSS” text area on the “Plugin Options” screen, where
   it should replace the code that you posted above.
 * Regards,
    Tobias
 *  Thread Starter [tchapman95](https://wordpress.org/support/users/tchapman95/)
 * (@tchapman95)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/one-table-not-centering/#post-6308618)
 * Hi Tobias,
 * Thanks for the code suggestion. However, this is changed the width of other tables
   on other pages. It has extended them back to the width of the container.
 * [http://texanscap.com/arian-foster-salary-cap-page/](http://texanscap.com/arian-foster-salary-cap-page/)
 * The first table (player contract details) was narrow, but after the above code
   change it back to extending the width of the container. I was hoping to get it
   narrow like before.
 * Troy
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/one-table-not-centering/#post-6308619)
 * Hi,
 * ok, then please use
 *     ```
       .tablepress-table-centered,
       .dataTables_wrapper .tablepress-table-centered {
       	width: auto;
       	margin: 0 auto 1em !important;
       }
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [tchapman95](https://wordpress.org/support/users/tchapman95/)
 * (@tchapman95)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/one-table-not-centering/#post-6308624)
 * Thanks Tobias, looks like that cleaned it up.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/one-table-not-centering/#post-6308627)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘One table not centering’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/one-table-not-centering/#post-6308627)
 * Status: resolved