Title: Adding Format to Multiple Tables
Last modified: August 21, 2016

---

# Adding Format to Multiple Tables

 *  Resolved [carolynyalin](https://wordpress.org/support/users/carolynyalin/)
 * (@carolynyalin)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/adding-format-to-multiple-tables/)
 * Hi Tobias,
 * I have about 10 tables I want formatted the same. Instead of writing them all
   out like this
 * `.tablepress-id-4 thead th,
    .tablepress-id-4 tbody td { text-align: center; }
 * .tablepress-id-4 td {
    border: 1px solid #ddd; }
 * .tablepress-id-4 th {
    border: 1px solid #fff; }
 * .tablepress-id-4 {
    font-weight: bold; width: 500px !important; }
 * /*Table 3 – Guided Pricing*/
    .tablepress-id-3 thead th, .tablepress-id-3 tbody
   td { text-align: center; }
 * .tablepress-id-3 td {
    border: 1px solid #ddd; }
 * .tablepress-id-3 th {
    border: 1px solid #fff; }
 * .tablepress-id-3 {
    width: 500px !important; }
 * }
 * .tablepress-id-3 {
    font-weight: bold; }’
 * What is the shorthand?
    Is it .tablepress-id-3,4,5,6?
 * Thanks,
    Carolyn
 * [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, 7 months ago](https://wordpress.org/support/topic/adding-format-to-multiple-tables/#post-4117498)
 * Hi Carolyn,
 * thanks for your question.
 * The shorthand to combine multi CSS blocks is to combine the entire CSS selector.
   
   In your example, that would be
 *     ```
       .tablepress-id-3,
       .tablepress-id-4,
       .tablepress-id-5,
       .tablepress-id-6 {
        ...
       }
       ```
   
 * So, as a more detailed example with your code:
 *     ```
       .tablepress-id-3 thead th,
       .tablepress-id-3 tbody td,
       .tablepress-id-4 thead th,
       .tablepress-id-4 tbody td {
         text-align: center;
       }
       .tablepress-id-3 td,
       .tablepress-id-4 td {
         border: 1px solid #ddd;
       }
       .tablepress-id-3 th,
       .tablepress-id-4 th {
         border: 1px solid #fff;
       }
       .tablepress-id-3,
       .tablepress-id-4 {
         font-weight: bold;
         width: 500px !important;
       }
       ```
   
 * Another approach would be to “invent” a new “Extra CSS class” and give that to
   each of the desired tables (on their “Edit” screen). With that, you could shorten
   the code even more. To then apply the styling to another table, you’d just give
   that table that “Extra CSS class” as well, without having to extend the “Custom
   CSS”.
 * Regards,
    Tobias

Viewing 1 replies (of 1 total)

The topic ‘Adding Format to Multiple Tables’ 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

 * [multiple-tables](https://wordpress.org/support/topic-tag/multiple-tables/)

 * 1 reply
 * 2 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/adding-format-to-multiple-tables/#post-4117498)
 * Status: resolved