Table in WordPress defaulting text formatting
-
I had a table on one of my pages that until recently, worked just fine. I saw today that the table is defaulting the text formatting when it used to work just fine with it. The link to the page in question is below; any ideas?
-
Could you be a little more specific about what text is not showing the way you expected?
Sure, the text is actually bigger than all the text on other pages, and on that page.
The purple headers in the table should be smaller than the page header, but they’re bigger. The regular text in the table is a lot bigger than the text outside of the table.
Simply put, it doesn’t match with the rest of the pages.
It took a little sleuthing, but it’s because you (or the theme designer) did not do a full CSS reset. In particular, text inside of a table must be explicitly styled. Put the following somewhere in your style.css file and I think it will make things look like you wanted them.
table {font-size: 100%}Thank you, that did the trick!
I guess the thing that confuses me is that until this week, this was not an issue. So, why did it work prior without it?
Haven’t got a clue. One thing I do know (from more than 30 years in the business) is that when someone says “But I didn’t change anything!” it almost always is the case that either a) actually, they did change something and forgot about it, or b) something in their environment changed (and that’s a long list of somethings).
BTW, all designs should start with a CSS file that does a down-to-the-metal reset of everything: colors, borders, margins, padding, font size/family/line-height, list style, etc., etc. This deals with “browser defaults” which a) are different from browser to browser, and b) are mostly badly thought out and they suck. So reset everything and then style to taste.
See the inimitable Eric Meyers for more on this subject. http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/
Thanks again for your input.
I guess that while it works now, it seems redundant. Because then, in order to have the text in the table match the text in the body, you have to style each separately, whereas in the ten years I’ve fiddled with websites, haven’t had to be this explicit.
Not trying to start an argument, just trying to understand more so in the future, situations like this won’t arise, or can be handled on my own.
No argument on my side. The foundation for this problem goes all the way back to the original graphical browsers (NCSA, Netscape, MSIE) who set default styles for H1-H6, P, TD, UL, LI, etc. It was well intentioned, but it led to people “assuming” (always a bad word) that a particular tag would yield a particular result.
As web pages took on more and more sophisticated styling, people didn’t realize that they were styling on top of the browser defaults and, hence, could get wildly unpredictable results from browser to browser.
Eric Meyer (who I mentioned above) was/is one of the true leaders in taking CSS to the limit. His reset.css was seen by some as making more work for them, but the people who were deep in the trenches on major sites (which had to look the same to all visitors) understood that what he was doing was creating a level playing field across browsers. (BTW, for an inspiring look at what you can do just by changing the CSS, see the CSS Zen Garden.)
This CSS situation is directly analogous to the problem with JavaScript. Instead of reset.css, people turn to one of the libraries (e.g. jQuery) that do a very good job of hiding the swamp of inconsistent & broken JS implementations that are still in existence.
Thanks for the info; that helps a lot!
The topic ‘Table in WordPress defaulting text formatting’ is closed to new replies.