Title: Column Align Based on Value
Last modified: August 22, 2016

---

# Column Align Based on Value

 *  Resolved [Laverneus Dinglefoot](https://wordpress.org/support/users/laverneus-dinglefoot/)
 * (@laverneus-dinglefoot)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/column-align-based-on-value/)
 * Tobias,
 * Sorry if this has been asked; I looked through a lot of support questions and
   couldn’t find this question.
 * I use your tables for sports stats, so each row has both text and numbers. I 
   have figured out how to automatically right align or let align everything, but
   I really want to have every table automatically left align all text and right
   align all numerals.
 * So team/player names will always be left aligned, but their stats will always
   be right aligned. I would want to apply this to all tables, not just individual
   tables.
 * Here is a link for an example of how I use the tables:
    [](http://nflsgreatest.co.nf/2014/10/quarterly-report/)
 * Thanks for all your help.
 * Bryan
 * [https://wordpress.org/plugins/tablepress/](https://wordpress.org/plugins/tablepress/)

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/column-align-based-on-value/#post-5365764)
 * Hi Bryan,
 * thanks for your post, and sorry for the trouble.
 * Unfortunately, TablePress can not detect the data type of a column automatically
   and then apply styling (like text alignment) to that automatically. You can only
   add that manually by adding corresponcing “Custom CSS” code.
 * Now, as your tables seem to have text in the first two columns and numbers in
   the remaining ones, this “Custom CSS” might be good starting point:
 *     ```
       .tablepress th,
       .tablepress td {
         text-align: right;
       }
       .tablepress .column-1,
       .tablepress .column-2 {
         text-align: left;
       }
       ```
   
 * (That code first right-aligns all cells and then aligns the first two columns
   to the left again.)
 * For individual tables that have a different structure, you can then override 
   this again.
    If you have many columns in the same structure (number of columns,
   alignment in those, etc.) you could also think about using “Extra CSS classes”
   to group the tables. That can then help to shorten your “Custom CSS” — if you
   actually need to override that suggestion for a new default value from above.
 * Regards,
    Tobias
 *  Thread Starter [Laverneus Dinglefoot](https://wordpress.org/support/users/laverneus-dinglefoot/)
 * (@laverneus-dinglefoot)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/column-align-based-on-value/#post-5365806)
 * Thanks again for all the help. You’re definitely the most helpful plugin author
   I have ever dealt with. I will use these suggestions.
 * As a side note, how difficult would it be for you to include the option to align
   columns L/C/R on the table editing screen? It could save you a lot of questions
   from humans like me.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/column-align-based-on-value/#post-5365813)
 * Hi,
 * no problem, you are very welcome! 🙂 Always glad when I can help!
 * Adding alignment options directly to the “Edit” screen is not really a good idea
   for the majority of users, in my opinion. While there will definitely be users
   that benefit from this, there are also others that will be confused by the extra
   options. As the “Edit” screen is already cluttered enough with buttons, text 
   fields, and checkboxes, I’d rather not add more. Also, if I do this for alignment,
   I’d probably have to add this for other styling properties as well. But then 
   again, it could never be added with the same flexibility that CSS offers.
 * Best wishes,
    Tobias

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

The topic ‘Column Align Based on Value’ 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

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

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/column-align-based-on-value/#post-5365813)
 * Status: resolved