Title: Image alignment
Last modified: April 9, 2025

---

# Image alignment

 *  Resolved [Dmitriy](https://wordpress.org/support/users/dmitrd/)
 * (@dmitrd)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/image-alignment-53/)
 * Images cannot be aligned to the center of the cell.
 * Inserting HTML does not help
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fimage-alignment-53%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Milos Jovanovic](https://wordpress.org/support/users/milosjovanovicwpdt/)
 * (@milosjovanovicwpdt)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/image-alignment-53/#post-18408599)
 * Hello,
   We are not able to reproduce this issue if we use the Simple Table’s ‘
   insert media’ tool in the back-end editor.Here is a screenshot; it will automatically
   center the image in the cell by default :
 * > [View post on imgur.com](https://imgur.com/Ax5x0NA)
 * And here is how it will look in the Desktop table version on the front end :
 * > [View post on imgur.com](https://imgur.com/a/NILxelD)
 * 
   Now, in your table cell, it seems you wrote the Custom HTML manually and made
   a DIV with a paragraph inside and then the img tag inside it.We tried the same,
   and we still can’t reproduce any issue with the image alignment.On our tables,
   the images are still centered.Here is the HTML code we tried in the cell :
 *     ```wp-block-code
       <div><p><img src="http://localhost/current/wp-content/uploads/2025/04/Sunny-80x80-1.png"/></p></div>
       ```
   
 * And screenshots how the image renders, centered by default ( we tried with or
   without the CSS “text-align center” and it works the same).
 * > [View post on imgur.com](https://imgur.com/YESbZiW)
 * > [View post on imgur.com](https://imgur.com/fVuO69O)
 * Can you please check how the table looks in the back end preview?
   If the table
   loads the images centered on the back-end preview version, and this issue only
   happens on front-end, that means your Theme is probably overriding our default
   CSS/styles.Try changing your Theme to any other and refresh the Page.
 * In any case, you can ‘force’ these images in our table cells to be centered via
   this CSS code :
 *     ```wp-block-code
       #wpdtSimpleTable-4 td img {    display: block !important;margin-left: auto;margin-right: auto;}
       ```
   
 * > [View post on imgur.com](https://imgur.com/a/yfvMYgt)
 * This CSS focuses only this table ID 4 from the Page.
   Add this to the Main Plugin
   settings/Custom JS and CSS/Custom CSS.If you wish to do one piece of code, which
   will align all images in all your Simple tables to center, you can remove the
   Table ID, and use this code instead :
 *     ```wp-block-code
       .wpdt-c.wpDataTableContainerSimpleTable .wpdtSimpleTable td img {display: block !important;margin-left: auto;margin-right: auto;}
       ```
   
 * 
   I hope that helps.Kind regards
 *  Thread Starter [Dmitriy](https://wordpress.org/support/users/dmitrd/)
 * (@dmitrd)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/image-alignment-53/#post-18411594)
 * Thank you for your reply.
 * Preview and page on site are there:
   [https://school.dmitrd.h1n.ru/errors](https://school.dmitrd.h1n.ru/errors/)
 *  Plugin Support [Milos Jovanovic](https://wordpress.org/support/users/milosjovanovicwpdt/)
 * (@milosjovanovicwpdt)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/image-alignment-53/#post-18421761)
 * Hello,
   Apologies for such long waiting time on this reply.Thank you for your 
   patience.As far as we can see, in the back-end preview, all the images are centered.
   And only on the front-end version, it is aligned to the left.That means that 
   something else on your Site, like your current Theme perhaps, is overriding our
   table’s default styles.To isolate this, please change to any other WP Theme and
   refresh the Page, see if that solves it?If so – This confirms what we suspected.
   If you have to use this Theme, you can use the CSS fix we suggested above. We
   will copy it again :
 * Try changing your Theme to any other and refresh the Page.
 * In any case, you can ‘force’ these images in our table cells to be centered via
   this CSS code :
 *     ```wp-block-code
       #wpdtSimpleTable-4 td img {    display: block !important;margin-left: auto;margin-right: auto;}
       ```
   
 * This CSS focuses only this table ID 4 from the Page.
   Add this to the Main Plugin
   settings/Custom JS and CSS/Custom CSS.If you wish to do one piece of code, which
   will align all images in all your Simple tables to center, you can remove the
   Table ID, and use this code instead :
 *     ```wp-block-code
       .wpdt-c.wpDataTableContainerSimpleTable .wpdtSimpleTable td img {display: block !important;margin-left: auto;margin-right: auto;}
       ```
   
 * Kind regards,
   Milos
    -  This reply was modified 1 year, 1 month ago by [Milos Jovanovic](https://wordpress.org/support/users/milosjovanovicwpdt/).

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

The topic ‘Image alignment’ is closed to new replies.

 * ![](https://ps.w.org/wpdatatables/assets/icon-128x128.gif?rev=3010404)
 * [wpDataTables - WordPress Data Table, Dynamic Tables & Table Charts Plugin](https://wordpress.org/plugins/wpdatatables/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpdatatables/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpdatatables/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdatatables/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdatatables/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdatatables/reviews/)

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [Milos Jovanovic](https://wordpress.org/support/users/milosjovanovicwpdt/)
 * Last activity: [1 year, 1 month ago](https://wordpress.org/support/topic/image-alignment-53/#post-18421761)
 * Status: resolved