Title: Image margins &amp; padding
Last modified: January 10, 2021

---

# Image margins & padding

 *  Resolved [bartson2](https://wordpress.org/support/users/bartson2/)
 * (@bartson2)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/image-margins-padding/)
 * After exploring the html tables and flex box, etc I am coming back to TablePress
   but I am struggling.
    This table [https://patchencalifornia.com/home/trees/bargains/](https://patchencalifornia.com/home/trees/bargains/)
   is actually 3 tables because I have not been able to get the column widths I 
   want in a single table. Here are the shortcodes. [table id=12a responsive=scroll
   column_widths=”50%|50%”/] [table id=12b responsive=scroll column_widths=”20%|
   8%|8%|8%|8%|8%|8%|8%|8%|8%|8%”/] [table id=12c responsive=scroll column_widths
   =”20%|8%|8%|8%|8%|8%|8%|8%|8%|8%|8%”/]
 * Currently I am trying to get rid of the (margin, padding,?) around the images
   in column 2 of 12c and at the same time make all rows the same height.
    Note 
   that a 10 x 10 px image in column 2, row 5 produces a row height of 50 to 60 
   px but another 10 x 10 image in column 4, row 4 results in a different row height–
   very confusing. These are some of the css approaches I have tried (among many).
 * This works in 12b but I cannot get it to work, combined with the data in 12c
   /*
   Bargains Header2 */ .tablepress-id-12b .row-1 td { font-size: 16px; font-weight:
   bold; color: #006400; background-color: #dafabe; text-align: center; }
 * Here the horizontal align works but not the vertical.
    /* Bargains */ /* — table*/.
   tablepress-id-12c th, .tablepress-id-12c td { text-align: center; vertical-align:
   middle; } Trying to eliminate the space around the image. .tablepress-id-12c .
   row-4 td { padding: 1px; }
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fimage-margins-padding%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/image-margins-padding/#post-13888578)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * In your CSS, you are modifying the padding of the cells – but only for that row
   4. Instead, you’ll need to remove the margin around the images. Thus, please 
   replace
 *     ```
       .tablepress-id-12c .row-4 td {
         padding: 1px;
       }
       ```
   
 * by
 *     ```
       .tablepress-id-12c img {
           margin: 0 auto !important;
       }
       ```
   
 * Note the `!important` flag that I added here. This is used to override the CSS
   of the theme with a higher priority.
 * Regards,
    Tobias
 *  Thread Starter [bartson2](https://wordpress.org/support/users/bartson2/)
 * (@bartson2)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/image-margins-padding/#post-13918910)
 * Thank you. That works perfectly.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/image-margins-padding/#post-13919500)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](https://wordpress.org/support/plugin/tablepress/reviews/#new-post)
   here in the plugin directory. Thanks!

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

The topic ‘Image margins & padding’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/image-margins-padding/#post-13919500)
 * Status: resolved