<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chapter 42 &#187; tables</title>
	<atom:link href="http://chapter42.whitewhale.net/tag/tables/feed/" rel="self" type="application/rss+xml" />
	<link>http://chapter42.whitewhale.net</link>
	<description></description>
	<lastBuildDate>Thu, 30 Sep 2010 17:20:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tables and CSS columns, Part II: Making the best of a bad situation</title>
		<link>http://chapter42.whitewhale.net/2008/06/19/tables-and-css-columns-part-ii-making-the-best-of-a-situation/</link>
		<comments>http://chapter42.whitewhale.net/2008/06/19/tables-and-css-columns-part-ii-making-the-best-of-a-situation/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 00:27:44 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[free stuff]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[whitewhale]]></category>

		<guid isPermaLink="false">http://chapter42.whaleblogs.net/?p=53</guid>
		<description><![CDATA[So having said all that, the way we&#8217;re handling CSS columns these days is actually pretty cool.  Here&#8217;s some sample CSS, from a site in development with a 720px wide content area:
/* Column layouts */
.column { float:left; overflow:hidden;}
.columns { margin-bottom:20px; padding-top:10px; }
.three.columns .first { width:200px; padding-right:20px; }
.three.columns .second { width:200px; padding:0 20px; }
.three.columns .third { [...]]]></description>
			<content:encoded><![CDATA[<p>So <a href="http://chapter42.whaleblogs.net/?p=52">having said all that</a>, the way we&#8217;re handling CSS columns these days is actually pretty cool.  Here&#8217;s some sample CSS, from a site in development with a 720px wide content area:</p>
<pre>/* Column layouts */
.column { float:left; overflow:hidden;}
.columns { margin-bottom:20px; padding-top:10px; }
.three.columns .first { width:200px; padding-right:20px; }
.three.columns .second { width:200px; padding:0 20px; }
.three.columns .third { width:200px; padding-left:20px; }
.two.columns .first { width:300px; padding-right:20px; }
.two.columns .second { width:300px; padding-left:20px; }</pre>
<pre><span style="font-family: 'Lucida Grande'; line-height: 19px; white-space: normal;">This lets us code the XHTML like this:</span></pre>
<pre>&lt;div class="three columns"&gt;
     &lt;div class="first column"&gt;
         Column 1
     &lt;/div&gt;
     &lt;div class="second column"&gt;
         Column 2
     &lt;/div&gt;
     &lt;div class="third column"&gt;
         Column 3
     &lt;/div&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;/div&gt;  </pre>
<p>&#8230; which is pretty nice semantically.</p>
]]></content:encoded>
			<wfw:commentRss>http://chapter42.whitewhale.net/2008/06/19/tables-and-css-columns-part-ii-making-the-best-of-a-situation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tables and CSS columns, Part I: How an HTML table is like a cigarette</title>
		<link>http://chapter42.whitewhale.net/2008/06/19/tables-and-css-columns-part-i/</link>
		<comments>http://chapter42.whitewhale.net/2008/06/19/tables-and-css-columns-part-i/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 23:31:00 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bad habits]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[guilty pleasures]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[whitewhale]]></category>

		<guid isPermaLink="false">http://chapter42.whaleblogs.net/?p=52</guid>
		<description><![CDATA[You don&#8217;t use HTML tables for layout.  Every standards-based Web designer knows this.  
As of June 2008, this notion is so deeply buried in the conventional wisdom about Web page design that just about nobody ever thinks about it anymore; the idea of using a table for anything other than Tabular Data is met with [...]]]></description>
			<content:encoded><![CDATA[<p>You don&#8217;t use HTML tables for layout.  Every standards-based Web designer knows this.  </p>
<p>As of June 2008, this notion is so deeply buried in the conventional wisdom about Web page design that just about nobody ever thinks about it anymore; the idea of using a table for anything other than Tabular Data is met with scorn and derision from developers.  And so the lowly &lt;table&gt; tag sits alone in the lunchroom, friendless, with nobody to talk to except its perpetual hangers-on &lt;td&gt; and &lt;tr&gt;.</p>
<p>Now of course, we don&#8217;t use tables for layout at White Whale.  Ever.  How could we?  It&#8217;d be like driving an SUV, listening to a Zune, or voting Republican—<em> it&#8217;s something cool people just don&#8217;t do.</em>  We (as a company) couldn&#8217;t design a site with layout tables and look at ourselves in the morning.</p>
<p>But I don&#8217;t like conventional wisdom, and as a result I often find myself thinking about tables— in particular, how there are some things you can do with &lt;table&gt; that you can&#8217;t do with &lt;div&gt;, no matter how hard you try.  (At least across all browsers, and without using Javascript.)  <span id="more-52"></span></p>
<p>What makes it worse is that these are some REALLY, REALLY SIMPLE THINGS.  Like attaching a footer to the bottom of the viewport, or the bottom of the content area, whichever is appropriate.  Like displaying two columns of content, and having the width of the two columns be determined by whatever makes sense for the amount of content they contain.  Like setting a content area at, say, 10% width, unless your content contains a word like &#8220;supercalifragilisticexpialidocious,&#8221; in which case the content area won&#8217;t get any narrower. </p>
<p>Now, I know not many people read this blog, but if this were a serious CSS design blog (which we modestly hope it someday may be), I&#8217;m sure we&#8217;d get commenters tossing out &lt;div&gt;-based solutions for all these cases.  I am pretty good at CSS, but I&#8217;m certainly not a black belt, and it wouldn&#8217;t surprise me at all if there are some decent solutions out there.  But here&#8217;s the thing—<em>all this stuff is built into</em> &lt;table&gt;.  And all browsers get it.  Automatically.</p>
<p>&lt;table&gt; is a relic from a simpler time, when there was a general idea that common sense ought to govern how browsers render Web pages.  &lt;div&gt; is a creature of the present— all it knows is rules.  It knows nothing of &#8220;common sense.&#8221;  As a result, much of CSS design— even <a href="http://www.alistapart.com/articles/holygrail" target="_blank">the high end stuff</a>— becomes an attempt to duplicate in CSS behavior that comes naturally to a &lt;table&gt;.</p>
<p><a href="http://oikl.org/" target="_blank">Here&#8217;s a quick site I did last summer for a kickball league we started in Oakland.</a>  If you resize it a bit, making the page really small, really big, etc., you&#8217;ll see how there&#8217;s a 250px wide side column, a title at the top that changes color as it crosses the color line, and background images pegged to page bottom.  I must have spent four hours getting that to work in CSS, without success; once I decided to use a table, I coded it in five minutes.  </p>
<p>But of course, that&#8217;s a personal site; we could never have done that for a client site. Now, those of you who know us know that Donald is the most standards-obsessed Whale; he handles all our initial CSS buildouts once designs are approved.  We often have conversations like this:</p>
<blockquote><p><em>Jason:</em>  Why isn&#8217;t the buildout done yet?</p>
<p><em>Donald:</em>  Grrr!  I&#8217;m having a hard time getting (insert awesome design feature here) to work in IE6.</p>
<p><em>Jason: </em> Well, you know, you could use a table for that.</p>
<p><em>Donald:  </em>No I can&#8217;t.</p>
<p><em>Jason (knowing D hates when I ask this):  </em>Why?</p>
<p><em>Donald:</em>  Because tables aren&#8217;t accessible.</p>
<p><em>Jason:</em>  Are you suggesting that an audio browser isn&#8217;t able to interpret a one-row table?  Do you suppose, then, that <a href="http://www.google.com/" target="_blank">this page</a>, which uses a table for layout, is inaccessible?</p>
<p><em>Donald:</em>  It&#8217;s just not best practices.</p>
<p><em>Jason:  </em>Well, if it can be rendered by a screen reader, and it works across all modern browsers, and actually involves less code than a CSS solution, how is that not best practices?</p>
<p><em>Donald:</em>  People will laugh at us.</p>
<p><em>Jason:  </em>OK, fine.  But if we don&#8217;t get it solved by tomorrow afternoon, I&#8217;ll use tables and code it myself.</p></blockquote>
<p>And then Donald stays up all night and figures it out.</p>
<p>The fact is, I&#8217;m fine with &lt;div&gt;; I just wish sometimes it had some common sense.   And just like a former cigarette smoker might occasionally step out behind the house and indulge in the guilty pleasure of an old bad habit, I reserve the right to use tables occasionally in my own work.</p>
]]></content:encoded>
			<wfw:commentRss>http://chapter42.whitewhale.net/2008/06/19/tables-and-css-columns-part-i/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

