Title: css and DataTables JavaScript
Last modified: August 20, 2016

---

# css and DataTables JavaScript

 *  Resolved [brigerard](https://wordpress.org/support/users/brigerard/)
 * (@brigerard)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/css-and-datatables-javascript/)
 * Hello Tobias,
    When I use DataTables JavaScript with a table, css code to center
   the table does not work.
 * Regards Gerard
 * Here is my css code:
 *     ```
       .tablepress {
       margin-left: auto! important;
       margin-right: auto! important;
       width: 600px! important;
       }
   
       .tablepress th {
       font-family: Calibri;
       font-size: 14px;
       color: # 282828;
       background-color: # 787878;
       text-align: center;
       }
   
       .tablepress td {
       font-family: Calibri;
       font-size: 14px;
       text-align: center;
       color: # 282828;
       background-color: # D0D0D0;
       }
   
       .tablepress. {t even
       background-color: # F0F0F0;
       }
   
       .tablepress. odd td {
       background-color: # D0D0D0;
       }
   
       .tablepress. hover row-tr: hover td {
       background-color: # FFFF00! important;
       }
   
       .tablepress. {sorting
       background-color: # 787878;
       }
       ```
   
 * [http://wordpress.org/extend/plugins/tablepress/](http://wordpress.org/extend/plugins/tablepress/)

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/css-and-datatables-javascript/#post-3417320)
 * Hi Gerard,
 * please post a link to the page with the table that is not working. I’ll gladly
   take a look! (Just the CSS code is not enough for this unfortunately.)
 * Thanks!
    Tobias
 *  Thread Starter [brigerard](https://wordpress.org/support/users/brigerard/)
 * (@brigerard)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/css-and-datatables-javascript/#post-3417382)
 * Hello Tobias,
    I can not give a link, the test locally on my pc with WebMatrix.
   Looking at the css internet explorer, if I disable_**. Datatables\_wrapper. Tablepress**_,
   centering works. the specific css that I entered is overwritten by that of _**.
   datatables\_wrapper. tablepress**_link to image: [http://dl.dropbox.com/u/35036317/Capture.JPG](http://dl.dropbox.com/u/35036317/Capture.JPG)
 * cordially
    Gerard
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/css-and-datatables-javascript/#post-3417391)
 * Hi Gerard,
 * ah, ok. The local test is a bit unfortunate here, but I think we can fix it:
   
   Please replace your “Custom CSS” completely with this new one (in which I added
   pieces to make the .dataTables_wrapper class centered, and also fixed some syntax
   errors):
 *     ```
       .tablepress,
       .dataTables_wrapper {
       margin-left: auto !important;
       margin-right: auto !important;
       width: 600px;
       }
   
       .tablepress th {
       font-family: Calibri;
       font-size: 14px;
       color: #282828;
       background-color: #787878;
       text-align: center;
       }
   
       .tablepress td {
       font-family: Calibri;
       font-size: 14px;
       text-align: center;
       color: #282828;
       background-color: #D0D0D0;
       }
   
       .tablepress .even td {
       background-color: #F0F0F0;
       }
   
       .tablepress .odd td {
       background-color: #D0D0D0;
       }
   
       .tablepress .row-hover tr:hover td {
       background-color: #FFFF00 !important;
       }
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [brigerard](https://wordpress.org/support/users/brigerard/)
 * (@brigerard)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/css-and-datatables-javascript/#post-3417402)
 * it’s ok
    Thanks! Gerard
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/css-and-datatables-javascript/#post-3417403)
 * Hi,
 * great! Thanks for confirmation. Good to hear that this worked!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please rate TablePress here in the plugin directory.
   Thanks!

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

The topic ‘css and DataTables JavaScript’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/css-and-datatables-javascript/#post-3417403)
 * Status: resolved