Amazing Sales Videos

How To Fix Table Alignment Issues in WordPress Twenty Ten Theme

By

Nothing is more frustrating than spending hours trying to get your images and text all set up in your WordPress page or post table, only to find that once you save it everything looks all wonky.  You know you have the alignment settings right, including using valign to center the text and images in the middle of their cells.

It works great in other themes and unless you had access to other WordPress sites you might not have thought about testing it that way.

Come to find out, there’s something weird in the global reset section of the style.css stylesheet of the Twenty Ten default theme that’s making this happen. Thanks to a thread at http://wordpress.org/support/topic/problem-with-table-alignment-in-posts-for-twentyten-theme-1, I found the solution that worked great.

By removing or commenting out the vertical-align: baseline line from the global reset section, then saving your changes, you’ll find that the table will look exactly as you had wanted.

Here are some screenshots so you can see what I’m talking about:

Before the change: A 2-column table with images in the left column and text in the right column. A very common scenario.

2010tablewrong1 450x419 How To Fix Table Alignment Issues in Wordpress Twenty Ten Theme

 

The style.css file with the default vertical align setting. You’re looking for vertical-align: baseline:

2010csschange1 389x450 How To Fix Table Alignment Issues in Wordpress Twenty Ten Theme

 

Same file with the line commented out:

2010csschange 349x450 How To Fix Table Alignment Issues in Wordpress Twenty Ten Theme

Table alignment is now looking as it should. FINALLY!:

2010tablefixed 450x406 How To Fix Table Alignment Issues in Wordpress Twenty Ten Theme

 

Upgrading the WordPress software after making this change did not undo the changes to the stylesheet, as I had feared would happen. Of course, that was testing an upgrade on a site using the child theme, Twenty Ten Weaver. The upgrade was on site where the change was made to that stylesheet. Will have to test this after upgrading WordPress on a site not using any child theme. The change to the default Twenty Ten theme works great, it’s just that I don’t have any Twenty Ten sites that need upgrading as of right now.

-- For quick access to similar posts:

Categories : Wordpress Tutorials

10 Comments

1

Oh my god, thank you so much. I have spent so long trying to find the solution…okay, just a few hours. Thanks for such wonderful and clear instructions. I’ll make sure to put a link to this site once I have fully converted to the wordpress layout.

2

By the way, this also works for the sliding doors theme, and so I would imagine any theme that is having similar issues.

3

Thank You good Man ! Very Much !

4

Thanks – been looking for this fix for a while!!!

5

Thank You!

For some reason, when commented out on the child theme, the changes were not registered. But when commented on the original CSS file, it worked. I guess that will do for now until I figure out why my child theme is not registering my changes.

6

Interesting. Thank you for sharing your experience. Others will appreciate, I’m sure.
Andrea

7

holy cranberries. I have been searching for this gem of information for three solid years. Thanks, This is truly the holy grail of table editing in WordPress!

8

Thanks, Andrea! It worked like a mother-loving charm! :-)

9

Thank you * 10 !!!
A lifesaver

10

Been looking for the solution to this for 4 hours “The vertical baseline trick ” Thank you!!!!!!!!!!!!!!!!!!