{"id":998,"date":"2007-03-02T17:00:49","date_gmt":"2007-03-02T22:00:49","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=998"},"modified":"2007-03-02T20:29:16","modified_gmt":"2007-03-03T01:29:16","slug":"tables-vs-div-tags","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=998","title":{"rendered":"Tables vs. Div Tags"},"content":{"rendered":"<p>In <a href=\"?p=994\">yesterday&#8217;s post<\/a> I had some fun at the expense of XML coding standards.  I linked <a href=\"http:\/\/meyerweb.com\/\">Eric Meyer<\/a> in that post.  Upon later reflection, I thought this might be seen as a little rude &#8211; akin to linking <a href=\"http:\/\/denbeste.nu\/Chizumatic\/\">Steven<\/a> in a post lampooning anime as trivial cartoons and a waste of time.  He was a good sport about it, and if I irritated him he didn&#8217;t let on.  <\/p>\n<p>I admit that my post was mostly just me mocking what I do not understand. A few people pointed out some perfectly good reasons for coding standards and what they have to offer a web developer.  I know coding standards are very important in C++ (my day job, as it were) and and I would balk if someone suggested that coding style was just needless fussing.  If you mean to maintain a couple of millions of lines of code, you had better have some sort of clearly-defined standards or those lines of code will very quickly devour you.  You will be a lion tamer who just showed up without his whip and covered in barbecue sauce.  You&#8217;re screwed. <\/p>\n<p>I&#8217;m sort of getting my head around the concept of keeping the information seperate from formatting, and while I would never try that myself I admit that I&#8217;m not exactly dealing with a huge collection of pages here. (I coded this theme pretty much from scratch, and when I did so I thought of it as writing PHP, not HTML.) The need for this thing probably emerges as the job gets larger.  Following strict standards for a site like mine would probably be like hiring an architect and a contractor to build a wooden crate.  <\/p>\n<p>Anyway, I pretty much get it up to a point, although there is one thig I don&#8217;t get, which is replacing TABLEs with DIVs. Maybe a CSS Jedi can explain this one to me. Most WordPress themes &#8211; as in, 99% of the themes I&#8217;ve seen &#8211; use DIVs for layout.  The problem is that divs and tables have different failure modes. The typical theme is something like a page with a 500 pixel column and a 200 pixel sidebar.  With divs, if the unwitting user posts an image that is 501 pixels wide, the sidebar gets bumped all the way to the bottom of the page. Or shift to the opposite side. Or suddenly go underneath the main column. This can be maddening for the user to figure out.  Worse, this is really where browsers diverge in behavior.  It might work just fine in Firefox, but in IE the sidebar will go missing.  If that sidebar is used to help put other stuff into position, then very quickly the entire theme collapses like a house of cards and you&#8217;ve got content all over the place. But only in some browsers. This is very common, and the reason I abandoned public themes for something I made myself.  I got tired of capricious puzzle themes that would spew content when they broke.<\/p>\n<p>With tables, the wide image will just force the cell to go a little wider.  Maybe this will introduce a seam elsewhere.  Maybe it will bring about a few pixels of horizontal scrolling.  Maybe it will work just fine.  In any event, the cause of the problem is much easier to spot.  I couldn&#8217;t figure out how you could reproduce this more graceful behavior using CSS.  Maybe CSS isn&#8217;t robust enough to do this, or maybe there are attributes theme authors don&#8217;t know how to use properly.  Keep in mind that when you&#8217;re designing a theme, you&#8217;re writing code to be used by people with a lot less expertise than yourself, who may not know the &#8220;rules&#8221; of your theme.  Graceful failure with a clear cause becomes an important issue.<\/p>\n<p>Maybe this isn&#8217;t so much a problem with standards as it it people adhering to standards when they shouldn&#8217;t.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In yesterday&#8217;s post I had some fun at the expense of XML coding standards. I linked Eric Meyer in that post. Upon later reflection, I thought this might be seen as a little rude &#8211; akin to linking Steven in a post lampooning anime as trivial cartoons and a waste of time. He was a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-998","post","type-post","status-publish","format-standard","hentry","category-links"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=998"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/998\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}