Title: Text alignment in columns
Last modified: August 21, 2016

---

# Text alignment in columns

 *  Resolved [keithvaugh](https://wordpress.org/support/users/keithvaugh/)
 * (@keithvaugh)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/text-alignment-in-columns/)
 * Hi
 * I have created a table where I want the text in the left column to be aligned
   left and all other columns aligned center. The only CCS that I have found that
   seems to works is:
 *     ```
       .tablepress thead th {
       	background-color: transparent;
       	text-align: center;
       }
   
       .tablepress .column-1 td {
       	text-align: left;
       }
   
       .tablepress .column-1 {
       	width: 300px;
       }
   
       .tablepress-id-1 .column-2 {
       	text-align: center;
       }
   
       .tablepress-id-1 .column-3 {
       	text-align: center;
       }
       ```
   
 * As you can see you have to virtually add the same code for each column. I have
   tried:
 *     ```
       .tablepress-id-1 .column-2 .column-3 .column-4 {
       	text-align: center;
       }
       ```
   
 * But that doesn’t seem to work. Is there a tidy way of achieving this?
 * Thanks in advance.
 * [http://wordpress.org/plugins/tablepress/](http://wordpress.org/plugins/tablepress/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/text-alignment-in-columns/#post-4260907)
 * Hi,
 * thanks for your question, and sorry for the trouble.
 * Combining CSS selectors works slightly different. In your example, that would
   be
 *     ```
       .tablepress-id-1 .column-2,
       .tablepress-id-1 .column-3,
       .tablepress-id-1 .column-4 {
       	text-align: center;
       }
       ```
   
 * However, the better and simpler solution should be to set the alignment to “center”
   for all columns first, and then set it to “left” again for the first column. 
   That way, you don’t have to adjust the code everytime you add a column:
 *     ```
       .tablepress-id-1 th,
       .tablepress-id-1 td {
       	text-align: center;
       }
       .tablepress-id-1 .column-1 {
       	text-align: left;
       }
       ```
   
 * Regards,
    Tobias

Viewing 1 replies (of 1 total)

The topic ‘Text alignment in columns’ 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/text-alignment-in-columns/#post-4260907)
 * Status: resolved