Title: WordPress theme and MLA styling
Last modified: August 21, 2016

---

# WordPress theme and MLA styling

 *  Resolved [estr](https://wordpress.org/support/users/estr/)
 * (@estr)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/wordpress-theme-and-mla-styling/)
 * Hello,
 * This is not related to any problem with the plugin itself, but having exhausted
   my own ideas on how to fix styling, I would like to ask if perhaps you would 
   be able to assist with that. That would be awesome if you could 🙂
 * The problematic page at hand [is here](https://servicecore.info/2013/09/thesisdissertation-template-and-output-example-with-beautiful-professional-style/).
 * Currently it is in its initial totally problematic state, just to put things 
   into perspective.
 * The gallery was made to look better by adding this code:
    [code]#top .gallery.
   gallery-item {width: 215px; height: auto;}[/code]
 * And the screenshot of this page, with this fix applied, can be examined at the
   end of the page. Perhaps you might have a better idea on how to fix this particular
   issue, and that is why I have reverted this fix. But if not that is fine.
 * The issue that I would like to ask to assist with, if possible, is how to center
   the gallery.
 * I have tried various centering techniques that I could find, but I was not successful
   in applying any of them.
 * Perhaps you might have an idea on how to center the gallery with the current 
   WordPress theme?
 * Thank you!
 * Regards
 * [http://wordpress.org/plugins/media-library-assistant/](http://wordpress.org/plugins/media-library-assistant/)

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

 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/wordpress-theme-and-mla-styling/#post-4120344)
 * Thanks for this question and for taking the time to document the problematic 
   page.
 * I must admit that CSS is not one of my strong points, but here are some suggestions
   that might help. You have probably already tried some of them. I found this page
   of suggestions:
 * [Centering Things](http://www.w3.org/Style/Examples/007/center.en.html)
 * The easy answer is to fix the width of the enclosing `< div >`. For example, 
   the first (thumbnail) gallery on your page can be set to a width of 35% and it
   will center itself because of the `margin:auto` property. As the “Centering Things”
   page says,
 * > This is normally used with a block of fixed width, because if the block itself
   > is flexible, it will simply take up all the available width.
 * This only works if you know how many items are in the gallery, though.
 * The other approach is to create a custom MLA Gallery template and change from
   a div-based template to a table-based template, because a table can be centered
   with `align=center`. If you consider the `align` attribute obsolete you can still
   construct a table of variable width and rely on the `margin=auto` to center it.
 * There is a table-based template in the Settings/Media Library Assistant Documentation
   tab you can use as a starting point. I am about to leave town for a week and 
   unable to build and test a specific example for you. Give the table idea a try
   and let me know how it goes. I can give you more help when I return from my travels.
 * Thank you for your understanding and your patience.
 *  Thread Starter [estr](https://wordpress.org/support/users/estr/)
 * (@estr)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/wordpress-theme-and-mla-styling/#post-4120354)
 * Thanks to your input I now have more options to pursue, and I am sure will finally
   get it right.
 * Thank you for your time! 🙂
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/wordpress-theme-and-mla-styling/#post-4120491)
 * I am back home and had a bit more time to spend on this issue. Here is a fairly
   simple table-based style and template that works with the WordPress Twenty Twelve
   theme.
 * **Style Template**
 *     ```
       <style type='text/css'>
       	#[+selector+] {
       		width: 300px;
       		margin: auto;
       	}
       	#[+selector+] .gallery-row {
       		margin-top: 10px;
       		border-top: 1px solid #ddd;
       		text-align: center;
       	}
       	#[+selector+] .gallery-row td.gallery-icon {
       		width: 60px;
       		height: 60px;
       		vertical-align: top;
       	}
       	#[+selector+] .gallery-row .gallery-icon img {
       		border: 2px solid #cfcfcf;
       	}
       	#[+selector+] .gallery-caption {
       		margin-left: 0;
       		vertical-align: top;
       	}
       </style>
       <!-- see mla_gallery_shortcode() in media-library-assistant/includes/class-mla-shortcodes.php -->
       ```
   
 * **Markup Template, Open**
 *     ```
       <table id='[+selector+]' class='gallery galleryid-[+id+] gallery-columns-[+columns+] gallery-size-[+size_class+]'>
       ```
   
 * **Markup Template, Row Open**
 *     ```
       <tr class='gallery-row'>
       ```
   
 * **Markup Template, Item**
 *     ```
       <td class='gallery-icon'>
       	[+link+]<br>[+caption+]
       </td>
       ```
   
 * **Markup Template, Row Close**
 *     ```
       </tr>
       ```
   
 * **Markup Template, Close**
 *     ```
       </table>
       ```
   
 * The first style, `#[+selector+]`, gives the table its total width and the `margin:
   auto;` style is all that’s required to center the table in its enclosing container.
 * If you found a different and/or better approach it would be great to share it
   here for all interested parties. Thanks again for raising an interesting and 
   useful topic.
 *  Thread Starter [estr](https://wordpress.org/support/users/estr/)
 * (@estr)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/wordpress-theme-and-mla-styling/#post-4120494)
 * Thank you once again for looking into this! I’m now using MLA on a different 
   project and your approaches are better than anything I’ve come up myself 🙂

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

The topic ‘WordPress theme and MLA styling’ is closed to new replies.

 * ![](https://ps.w.org/media-library-assistant/assets/icon-256x256.png?rev=973502)
 * [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-assistant/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-assistant/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-assistant/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-assistant/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-assistant/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [estr](https://wordpress.org/support/users/estr/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/wordpress-theme-and-mla-styling/#post-4120494)
 * Status: resolved