Title: Align row text
Last modified: August 20, 2016

---

# Align row text

 *  Resolved [jphipps](https://wordpress.org/support/users/jphipps/)
 * (@jphipps)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/align-row-text/)
 * Would like to align text in row to middle of cell. Am using this:
 * .tablepress-id-2 .row-1 {
    font-weight: bold; vertical-align:middle; }
 * Which does not seem to work…
 * Thanks.
 * [http://wordpress.org/extend/plugins/tablepress/](http://wordpress.org/extend/plugins/tablepress/)

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/align-row-text/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/align-row-text/page/2/?output_format=md)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288400)
 * Hi,
 * can you please post the link to the page with the table? There’s probably some
   theme CSS also influencing this.
 * Regards,
    Tobias
 *  Thread Starter [jphipps](https://wordpress.org/support/users/jphipps/)
 * (@jphipps)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288403)
 * [http://www.5axiswaterjetcutting.com/cutting-processes-compared/](http://www.5axiswaterjetcutting.com/cutting-processes-compared/)
 * Thanks
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288404)
 * Hi,
 * thanks for the link.
 * Instead of what you posted above, please try
 *     ```
       .tablepress-id-2 .row-1 td {
         font-weight: bold;
         vertical-align:middle;
       }
       ```
   
 * The “td” part is necessary here, as we need to target the cells directly.
 * If you also want to center the text horizontally, add
 *     ```
       text-align: center;
       ```
   
 * into the selector.
 * Regards,
    Tobias
 *  [cdnpatriot](https://wordpress.org/support/users/cdnpatriot/)
 * (@cdnpatriot)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288447)
 * Is there a code that can align all of the numbers to the right side of the second
   column.
 * [http://www.kanataimmigration.ca/permanent-residence-and-processing-fees](http://www.kanataimmigration.ca/permanent-residence-and-processing-fees)
 * Also, some of the second column numbers are not aligned how do I fix that?
    tried
   entering this but it didn’t work .tablepress-id-2 .row-1 td {
 *  vertical-align:right;
    }
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288448)
 * Hi,
 * thanks for your question.
 * You’ll just need this “Custom CSS” instead of what you posted:
 *     ```
       .tablepress .column-2 {
         text-align: right;
       }
       ```
   
 * I noticed something else: For most tables on that page, you have deactivated 
   all of the advanced features by unchecking the individual checkboxes. The better
   way to do that (results in better performance) is to just uncheck the “Use DataTables”
   checkbox for each of these tables.
 * Regards,
    Tobias
 *  [tomt333](https://wordpress.org/support/users/tomt333/)
 * (@tomt333)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288462)
 * I have tried to follow this example and the text looks correct in preview but
   not on live page….
 * [http://www.newchurchnc.org/groups/](http://www.newchurchnc.org/groups/)
 * It is the first table on this page I am trying to work with…
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288463)
 * Hi,
 * when working on columns, you must not put in the `td` after the `.column-123`
   in the selector. So, please replace
 *     ```
       .tablepress-id-2 .column-2 td {
       	vertical-align: middle;
       	text-align: center;
       }
       .tablepress-id-2 .column-3 td {
       	vertical-align: middle;
       	text-align: center;
       }
       ```
   
 * with
 *     ```
       .tablepress-id-2 .column-2,
       .tablepress-id-2 .column-3 {
       	vertical-align: middle;
       	text-align: center;
       }
       ```
   
 * Note that I also shortened and optimized the code by grouping it.
 * Regards,
    Tobias
 *  [tomt333](https://wordpress.org/support/users/tomt333/)
 * (@tomt333)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288464)
 * i have replaced it but still no luck….
 * in my code the words “middle” and “center” are in red….is that normal?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288465)
 * Hi,
 * ah, it looks like your theme also has CSS code that influences this. So, we just
   need to be a little bit more precise in the CSS. Please try again with
 *     ```
       #main .tablepress-id-2 .column-2,
       #main .tablepress-id-2 .column-3 {
       	vertical-align: middle;
       	text-align: center;
       }
       ```
   
 * And yes, the red color for these words is normal. Don’t worry too much about 
   this, it’s just a visual indication to spot “property” and “value” more easily.
 * Regards,
    Tobias
 *  [tomt333](https://wordpress.org/support/users/tomt333/)
 * (@tomt333)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288466)
 * perfect! thanks so much for your help…..i love this plugin
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288467)
 * Hi,
 * awesome! Good to hear that this worked 🙂
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](http://wordpress.org/support/view/plugin-reviews/tablepress)
   here in the plugin directory. Thanks!
 *  [whitespider71](https://wordpress.org/support/users/whitespider71/)
 * (@whitespider71)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288473)
 * Tobias,
 * I have tried the above CSS for my table that I’d like to have the text centered
   but it’s not working for me. I only need to do this for an entire table, not 
   specific columns, so I put in the following:
 * .tablepress-id-1 {
    vertical-align: middle; text-align: center; }
 * [Here’s a link to the page](http://sabf.t321.biz/event/valley-health-10k-race/)…
   very bottom, the Age Award Categories.
 *  [whitespider71](https://wordpress.org/support/users/whitespider71/)
 * (@whitespider71)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288474)
 * P.S. Everything seems to be bold too and I’m not sure why.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288475)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * First of all, please uncheck the “Table Head” and “Table Footer” checkboxes for
   this table. Those do not make sense here, from a semantical point of view. The
   background color of the table will then change, but you can then change that 
   again with some CSS code that is shown in the TablePress FAQ.
 * Then, to center the cells, please use this “Custom CSS” code:
 *     ```
       .tablepress-id-1 td {
         vertical-align: middle;
         text-align: center;
       }
       ```
   
 * Regards,
    Tobias
 *  [whitespider71](https://wordpress.org/support/users/whitespider71/)
 * (@whitespider71)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/align-row-text/#post-3288476)
 * Thank you sir! Got it working, only thing I’m running into is no border at the
   top of the table. I do have custom CSS for this which is …
 * .tablepress td {
    border: 1px solid #000000; }
 * And, is it possible to center the Table Name?
 * Thanks!

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/align-row-text/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/align-row-text/page/2/?output_format=md)

The topic ‘Align row text’ 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/)

 * 18 replies
 * 5 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/align-row-text/page/2/#post-3288479)
 * Status: resolved