Title: Vertical align problems in css
Last modified: August 20, 2016

---

# Vertical align problems in css

 *  Resolved [paulmhanson](https://wordpress.org/support/users/paulmhanson/)
 * (@paulmhanson)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/vertical-align-problems-in-css/)
 * Hello,
 * I’m having difficulty with vertically aligning text within cells in a table I
   have built using your plugin (which is very impressive, by the way!)
 * I have changed the css as directed and followed examples from your plugin page
   and W3C but I just cannot get the text to align correctly. Please could you tell
   me where I’m going wrong!?
 * Many thanks,
 * Paul
 * The table is here:
    [http://apocalypsegameshow.com/leaderboard/](http://apocalypsegameshow.com/leaderboard/)
 * My css code is here:
    .tablepress-id-2 td, .tablepress-id-2 th { background-color:#
   312f2f; font-size: 25px; vertical-align: middle; }
 * .tablepress-id-2 .column-2 {
    padding: 5px; }
 * My debug report is here:
    · Website: [http://apocalypsegameshow.com](http://apocalypsegameshow.com)·
   TablePress: 0.9-RC · TablePress (DB): 17 · TablePress table scheme: 3 · Plugin
   installed: 2013/01/28 23:11:46 · WordPress: 3.5.1 · Multisite: no · PHP: 5.3.21·
   mySQL (Server): 5.1.66-cll · mySQL (Client): 5.1.66 · ZIP support: yes · UTF-
   8 conversion: yes · WP Memory Limit: 40M · Server Memory Limit: 256M · Magic 
   Quotes: on · WP_DEBUG: false
 * [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/vertical-align-problems-in-css/#post-3447507)
 * Hi Paul,
 * thanks for your question, and sorry for the trouble.
 * The reason for this is that the TablePress Default CSS (which aligns the text
   to the top) has a higher precedence, as it uses a more specific CSS selector.
   Fortunately, this can be easily overruled by a small change in your CSS:
    Please
   change the line
 *     ```
       .tablepress-id-2 td,
       ```
   
 * to
 *     ```
       .tablepress-id-2 tbody td,
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [paulmhanson](https://wordpress.org/support/users/paulmhanson/)
 * (@paulmhanson)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/vertical-align-problems-in-css/#post-3447513)
 * Hi Tobias,
 * Super speedy response!
 * Made that change but my table is still not right (same link as above)..
 * I’ve now got this as my css:
 * .tablepress-id-2 tbody td
    .tablepress-id-2 th, { background-color: #312f2f; 
   font-size: 25px; vertical-align: middle; }
 * .tablepress-id-2 .column-2 {
    padding: 5px; }
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/vertical-align-problems-in-css/#post-3447532)
 * Hi,
 * (First: No need to post your “Custom CSS”, I can see that in the page 🙂 )
 * You have mixed up the commas a little bit now.
 *     ```
       .tablepress-id-2 tbody td
       .tablepress-id-2 th,
       ```
   
 * needs to be
 *     ```
       .tablepress-id-2 tbody td,
       .tablepress-id-2 th
       ```
   
 * So, just move the comma up one line.
 * Regards,
    Tobias
 *  Thread Starter [paulmhanson](https://wordpress.org/support/users/paulmhanson/)
 * (@paulmhanson)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/vertical-align-problems-in-css/#post-3447537)
 * Embarrassing! I spend all day at working writing SQL statements and then come
   home and miss out on where to put a comma in a list!
 * Tobias that works perfectly.. you’re a star!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/vertical-align-problems-in-css/#post-3447544)
 * Hi Paul,
 * don’t worry, this has happen to me so many times! And after staring at code like
   that for the entire day, it just happens 🙂
 * Great to hear that everything is working now! 🙂
 * 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 ‘Vertical align problems in css’ 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/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [vertical](https://wordpress.org/support/topic-tag/vertical/)
 * [vertical-align](https://wordpress.org/support/topic-tag/vertical-align/)

 * 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/vertical-align-problems-in-css/#post-3447544)
 * Status: resolved