<?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>KILLERSITES.COM &#187; CSS</title>
	<atom:link href="http://www.killersites.com/blog/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.killersites.com/blog</link>
	<description>Real world talk about web design, programming and the business of web design.</description>
	<lastBuildDate>Fri, 06 Nov 2009 16:49:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS Page Layout Strategies</title>
		<link>http://www.killersites.com/blog/2008/css-page-layout-strategies/</link>
		<comments>http://www.killersites.com/blog/2008/css-page-layout-strategies/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 03:57:52 +0000</pubDate>
		<dc:creator>Stefan Mischook</dc:creator>
				<category><![CDATA[Professional Web Design]]></category>
		<category><![CDATA[Real World Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.killersites.com/blog/2008/css-page-layout-strategies/</guid>
		<description><![CDATA[If you&#8217;ve been struggling with CSS based page layouts (as apposed to using tables) and you&#8217;ve been smacking your head against the wall to get things to work &#8230; believe me, you&#8217;re not the only one!
No, you&#8217;re not stupid &#8230; CSS for page layout is. 
What?! CSS is flawed?
Indeed. CSS for page layout sucks hard [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve been struggling with CSS based page layouts (as apposed to using tables) and you&#8217;ve been smacking your head against the wall to get things to work &#8230; believe me, you&#8217;re not the only one!</p>
<p>No, you&#8217;re not stupid &#8230; CSS for page layout is. </p>
<p><strong>What?! CSS is flawed?</strong></p>
<p>Indeed. CSS for page layout sucks hard because the logic behind CSS page layout is weak at best, and perhaps, even flawed. I can say this with experience in other languages like Java and even VB. Not that I am saying CSS is a programming language. </p>
<p>Anyway &#8230;</p>
<p>For web designers used to the craziness of CSS layouts, they would be flabbergasted at how easy creating layouts/views/screens are in VB or even Java when compared to CSS. </p>
<p><strong>What&#8217;s the main problem with CSS?</strong></p>
<p><span id="more-326"></span></p>
<p>The main problem with CSS (and HTML) is that it was not conceived as a user interface technology. Rather, it was considered and engineered as a document/page technology. </p>
<p>Think about it, we talk about <strong>web pages</strong> and not <strong>web user interfaces</strong>. </p>
<p>Despite the original intention of the Web being a bunch of documents, today the Web is largely a bunch of user interfaces. Yes, most web sites these days are much more like a user interface that we see in software than they are simple &#8216;pages&#8217;. So therein lies the core of the problem: </p>
<p><em>CSS was designed to style pages and not to build user interfaces. </em></p>
<p>-</p>
<p><strong>So what has happened?</strong></p>
<p>Well, because web designers realized the advantages of CSS for laying out pages, they figured out how to bend, stretch and sometimes break the very limited CSS technology to create modern web pages. </p>
<p>The problem is that you have a bunch of methods and practices that don&#8217;t really make much sense &#8230; logically speaking. That&#8217;s why when you are new to CSS, it is hard as heck to create many common layouts as compared to doing it in tables.</p>
<p>Think about it, a center aligned liquid layout with three columns is a snap to do with HTML tables. With CSS though, it took the community a long time to figure out how to get this to work. </p>
<p>&#8230; It shouldn&#8217;t take the <em>efforts of a community</em> to get common layouts to work. That is a sure sign of a broken technology.</p>
<p><strong><br />
Even the CSS nerds know it.</strong></p>
<p>Like most human beings, nerds are loath to admit when they&#8217;ve screwed up. So it&#8217;s pretty telling when you see the invention of CSS tables. Yes, CSS tables are basically tables created with CSS rather than with HTML. </p>
<p>CSS nerds finally realized that for user interfaces, you need a grid structure sometimes &#8230; tables are essentially grids. Problem is that CSS tables are not YET widely supported in the major browsers.</p>
<p><strong><br />
So why not use HTML tables if they are so easy?</strong></p>
<p>Because you would be missing out on the two big reasons for using CSS for page layout:</p>
<ol>
<li>CSS based pages are much easier to update and maintain.</li>
<li>CSS based pages are much <strong>more likely</strong> to work any many devices like iPhones, PDA&#8217;s, your printer etc&#8230;</li>
</ol>
<p>I want to comment on the touted advantages of CSS. First, most devices today have powerful browsers that can read just about any type of web page (CSS or not) &#8230; so you have to question the 2nd argument. You also hear other arguments about why you should use CSS:</p>
<ul>
<li>Your pages will be lighter in KB&#8217;s.</li>
<li>Your pages will be forward compatible.</li>
</ul>
<p>&#8230; Both these arguments have proven to be what I said they were years ago: total crap. So forget them.</p>
<p>So if HTML tables should not be used and CSS is crappy for page layout, what is a nerd to do? As always, I try to come to you with real solutions. Check it out &#8230;</p>
<p><strong>The Big Two CSS strategies:</strong></p>
<ol>
<li>Use templates</li>
<li>Use IE conditional comments</li>
</ol>
<p>Comments:</p>
<p>Since nerds have already gone through the trouble of figuring out the nuances of CSS, you don&#8217;t need to reinvent the wheel! Use a template and just build out from there.</p>
<p>If any issues should pop up where Internet Explorer is not working handling/displaying the CSS like FireFox, then just use <a href="http://www.killersites.com/blog/2006/ie-conditional-comments-video/">IE Conditional Comments</a> to solve the problem. </p>
<p>Thanks for reading,</p>
<p>Stefan Mischook (a.k.a.: The web design heretic)</p>
<p>www.killersites.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.killersites.com/blog/2008/css-page-layout-strategies/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Cleaner code is better than faster code</title>
		<link>http://www.killersites.com/blog/2008/cleaner-code-is-better-than-faster-code/</link>
		<comments>http://www.killersites.com/blog/2008/cleaner-code-is-better-than-faster-code/#comments</comments>
		<pubDate>Sun, 11 May 2008 17:29:43 +0000</pubDate>
		<dc:creator>Stefan Mischook</dc:creator>
				<category><![CDATA[Real World Web Design]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[hand coding]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.killersites.com/blog/2008/cleaner-code-is-better-than-faster-code/</guid>
		<description><![CDATA[I can&#8217;t tell you how many times that my programming experience (in Java, PHP etc) has guided me in my web design work &#8230; and strangely, even in other aspects of my life not at all related to topics &#8216;nerd&#8217;.
&#8230; Ah, nerd wisdom prevails in all aspects of life.
  
Anyway, here yet again, is [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t tell you how many times that my programming experience (in Java, PHP etc) has guided me in my web design work &#8230; and strangely, even in other aspects of my life not at all related to topics &#8216;nerd&#8217;.</p>
<p>&#8230; Ah, nerd wisdom prevails in all aspects of life.</p>
<p> <img src='http://www.killersites.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyway, here yet again, is another example where programming guides me: this time, it&#8217;s all about web design and code. </p>
<p>-</p>
<p>Over the last few years, the consensus in the web design community has been to streamline code. In real terms, that comes down to:</p>
<ul>
<li>collapsing html</li>
<li>collapsing css</li>
<li>&#8230; and consolidating css code into one file, to minimize the number of server hits.</li>
</ul>
<p>&#8230; The idea is to speed up web page load times and to reduce web server loads. </p>
<p>This is an important goal and something all web designers should be concerned about. The problem is that if you are concentrating on optimizing your CSS or HTML to speed things up, you are concentrating on the wrong parts of your websites.</p>
<p>The fact is, that most of the optimization opportunities is actually found in your images, Flash movies and other multimedia content &#8211; not the code. </p>
<p><span id="more-280"></span></p>
<p><strong>What is HTML and CSS code collapsing?</strong></p>
<p>In a nutshell:</p>
<p>This is simply removing white space in your code. So you can take this:</p>
<div style="margin-top: 30px; margin-bottom: 30px;">
<pre lang="html">


Web design rocks!



Web design rocks!

</pre>
</div>
<p>And cut it down to this:</p>
<div style="margin-top: 30px; margin-bottom: 30px;">
<pre lang="html">

Web design rocks!

Web design rocks!
</pre>
</div>
<p>&#8230; The idea is that if you cut down 7 lines of code to just 1 line, the file will be a touch smaller. And this is true.</p>
<p>This old-school technique was used back in the 1990&#8217;s when everyone was on slow dial-up Internet connections and everyone had much slower computers.</p>
<p>Collapsing code was once useful, but like the transparent spacer gif trick &#8230; it is no longer needed. Actually, it&#8217;s more trouble than it is worth. </p>
<p><strong>What can web designers learn from programmers?</strong></p>
<p>When it comes to code, the web design community is still (generally) not nearly as experienced as the programming community. There are still lessons to be learned by the average web designer, lessons that have been fundamental in software development for years.</p>
<p>&#8230; Programmers have known for years that when it comes to code, it is better make it cleaner than speedier, because clean code is much easier to read, write and maintain. </p>
<p>So in our example above, seven lines of code are better than one.</p>
<p><strong>What is &#8216;cleaner&#8217; code?</strong></p>
<p>Clean code can be broken down to:</p>
<ul>
<li>Lots of white space so the code is easy to read.</li>
<li>Lots of comments so that you can much more easily understand what is going on 6 months down the road.</li>
<li>Code that is &#8216;chunked&#8217; into logical groups so that (again) it is easy to update etc.</li>
</ul>
<p>The rise of object oriented programming is the best example of this understanding. </p>
<p>Object oriented code will almost always be slower (when running) than old school procedural programming. Nonetheless, object oriented programming now dominates the programming world and all the major languages use it including:</p>
<ul>
<li>Java</li>
<li>PHP</li>
<li>Ruby</li>
<li>Actionscript</li>
</ul>
<p>&#8230; and many others.</p>
<p>After decades of experience, programmers have learned through hard experience that cleaner code is much better than faster code.</p>
<p><strong>How does this apply to web design?</strong></p>
<p>Well, write cleaner css and HTML that is easier to understand and easier to work with. To repeat the list from above:</p>
<ul>
<li>Use lots of white space so the code is easy to read.</li>
<li>Use lots of comments (in your html and css) so that you will be more able to understand what is going on 6 months down the road. This becomes more important when you are dealing with tricky CSS layouts that require seemingly strange markup.</li>
<li>Organize your <a href="http://www.killersites.com/blog/2008/how-to-organize-css/">css into logical groups (and pages)</a> so that it is easy to update etc.</li>
</ul>
<p><strong><br />
Won&#8217;t cleaner code slow down my pages?</strong></p>
<p>The fact of the matter is, for the vast majority of websites (%99.99999999999999999) you will not see ANY difference in terms of speed or cost in bandwidth. </p>
<p>&#8230; The &#8216;optimize code to save money&#8217; is a wurban (Web + urban) myth.</p>
<p>Stefan Mischook</p>
<p>www.killersites.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.killersites.com/blog/2008/cleaner-code-is-better-than-faster-code/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Use Dreamweaver CS3 templates to save time</title>
		<link>http://www.killersites.com/blog/2008/dreamweaver-cs3-templates/</link>
		<comments>http://www.killersites.com/blog/2008/dreamweaver-cs3-templates/#comments</comments>
		<pubDate>Fri, 02 May 2008 01:46:16 +0000</pubDate>
		<dc:creator>Stefan Mischook</dc:creator>
				<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[learning web design]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.killersites.com/blog/2008/dreamweaver-cs3-templates/</guid>
		<description><![CDATA[Hi,
When I was working on the redesign of the killersites.com, I found (as a starting point) that the templates that ship with Dreamweaver CS3 useful.
Dreamweaver CS3 starter templates
Dreamweaver has a nice collection of bare-bones web templates. One thing I found cool about these templates, is that they contain a lot of notes that describe why [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>When I was working on the redesign of the killersites.com, I found (as a starting point) that the templates that ship with Dreamweaver CS3 useful.</p>
<p><strong>Dreamweaver CS3 starter templates</strong></p>
<p>Dreamweaver has a nice collection of bare-bones web templates. One thing I found cool about these templates, is that they contain a lot of notes that describe why they (the web-nerds at Adobe) have certain things in place &#8211; like the specific code they used to deal with a given CSS layout issue. </p>
<p>&#8230; This is another good way to learn more about CSS.</p>
<p><span id="more-272"></span></p>
<p><strong>An added bonus: tested layouts</strong></p>
<p>The templates are solid, in that you can be sure that they have been tested to work in the major browsers. </p>
<p>&#8230; This beats having to tinker with this yourself! That way, you can concentrate on the design.</p>
<p><strong><br />
The killersites.com facelift</strong></p>
<p><a rel="lightbox" href='http://www.killersites.com/blog/wp-content/uploads/2008/05/killersites-new-layout.png' title='killersites.com-web-design'><img src='http://www.killersites.com/blog/wp-content/uploads/2008/05/killersites-new-layout.thumbnail.png' alt='killersites.com-web-design' style="float: right; margin: 10px;" /></a></p>
<p>For my redesign of killersites.com, I used one of the Dreamweaver templates as a starting point. I found that it was well structured, such that it could withstand the changes I needed to make to it.</p>
<p>&#8230; Many CSS layouts are fragile, in that if you change just a little bit about it, the whole thing can start to fall apart.</p>
<p><strong>How to find the Dreamweaver CS3 templates</strong></p>
<p>Dreamweaver CS3 ships with many templates that you can access either by the &#8216;Welcome Screen&#8217; or by going into:</p>
<p><a rel="lightbox" href='http://www.killersites.com/blog/wp-content/uploads/2008/05/dreamweaver-new-document.png' title='dreamweaver-new-document'><img src='http://www.killersites.com/blog/wp-content/uploads/2008/05/dreamweaver-new-document.thumbnail.png' alt='dreamweaver-new-document' style='float: right; margin: 15px;' /></a></p>
<p>File > New </p>
<p>.. This will open up the &#8216;New Document&#8217; window where you will be able to choose from four categories:</p>
<ol>
<li>Blank Page</li>
<li>Blank Template</li>
<li>Page from Template</li>
<li>Page from Sample</li>
</ol>
<p>In &#8216;Blank Page&#8217;, I used a template called: &#8216;2 column liquid, left sidebar, header and footer&#8217;. Not the most exciting name, but it does tell you what you&#8217;re getting.</p>
<p>If you are a Dreamweaver CS3 user, or someone just interested in exploring quality CSS templates, I would suggest taking a look at the Dreamweaver templates.</p>
<p>PS: you can download a free <a href="http://www.adobe.com/products/dreamweaver/?ogn=EN_US-gntray_prod_dreamweaver_home">30 trial of Dreamweaver CS3</a> if you don&#8217;t have it already.</p>
<p>And if you are interested in learning Dreamweaver, you can view my free <a href="http://www.killersites.com/dreamweaver/">Dreamweaver video tutorials</a>.</p>
<p>Thanks,</p>
<p>Stefan Mischook</p>
<p>www.killersites.com<br />
www.killerphp.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.killersites.com/blog/2008/dreamweaver-cs3-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to organize your css code: the ‘killer’ css structure</title>
		<link>http://www.killersites.com/blog/2008/how-to-organize-css/</link>
		<comments>http://www.killersites.com/blog/2008/how-to-organize-css/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 16:05:11 +0000</pubDate>
		<dc:creator>Stefan Mischook</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Real World Web Design]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.killersites.com/blog/2008/how-to-organize-css/</guid>
		<description><![CDATA[I can&#8217;t stand articles that make you read two pages before getting to the point. With that in mind, let&#8217;s look at how I think css code should be organized.

In a nutshell: css code should be divided up into at least 4 separate pages:

page-structure.css
text-styles.css
misc.css
ie-styles.css

How about we call this the &#8216;killer&#8217; css structure.
  
Before I [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t stand articles that make you read two pages before getting to the point. With that in mind, let&#8217;s look at how I think css code should be organized.</p>
<p><img src='http://www.killersites.com/blog/wp-content/uploads/2008/02/picture-2.jpg' alt='php-video-tutorial' style="float: right; margin: 15px;" /></p>
<p><strong>In a nutshell:</strong> css code should be divided up into at least 4 separate pages:</p>
<ol>
<li>page-structure.css</li>
<li>text-styles.css</li>
<li>misc.css</li>
<li>ie-styles.css</li>
</ol>
<p>How about we call this the &#8216;killer&#8217; css structure.</p>
<p> <img src='http://www.killersites.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Before I go into the details of what each css file contains (if it&#8217;s not already obvious), I want to quickly cover WHY you might want to use this basic css structure for all your websites. </p>
<p><span id="more-270"></span></p>
<p><strong>Why use the &#8216;killer&#8217; css structure?</strong></p>
<p>It all comes down to one of the key reasons for using css in the first place: </p>
<p><strong><em>Grouping code so that it is easier to update and easier to understand.</em></strong></p>
<p>-</p>
<p><strong>A common mistake</strong></p>
<p>What I see over and over again, are web designers who put all their css code into one css file. This is indeed a big leap forward from using font tags all over your website &#8230; but by having only one huge css file, you&#8217;ve just created another big messy file to deal with. </p>
<p><strong>To the point</strong></p>
<p>Page-structure.css contains only css that defines the structure of your page. That is to say things like:</p>
<p>- css code that sets whether the page is liquid of fixed.<br />
- css code that sets whether the page is centered or justified left.<br />
- css code that sets up the columns</p>
<p>etc &#8230;</p>
<p>I like to put the page structure code in its&#8217; own file because page structure css code is verbose (there&#8217;s a lot) and it can get a little black-magical. </p>
<p><strong>What is black-magical css?</strong></p>
<p>We all know that except for the simplest css layouts, it can be a real pain in the ass to get page layout to work in css. </p>
<p>&#8230; Especially when floats and Internet Explorer bugs come into the mix. </p>
<p>Anyway, the point is that css for page layout often contains nonsensical (black-magical) code to make it work. </p>
<p><strong>OK, back to page-structure.css:</strong></p>
<p>Another reason to have page-structure.css, is that once you&#8217;ve done creating your page structure, you rarely have to go into that code. So why bother having to scroll past it every time you edit other parts of your css? </p>
<p>Personally I find myself tweaking css rules for text, color and images much more than I do page structure css. </p>
<p><strong>Text-styles.css</strong> contains css code that only affects text. So I have all my header tags defined along with paragraph tags and classes. Again, when needing to edit some aspect of my text for the hundredth time &#8230; I just pop open the very clean and simple text-styles.css.</p>
<p><strong>Misc.css</strong> is a style sheet that contains css code that does things other than page structure and text styling. This ultimately is a judgment call, but I typically put in formating for tables, forms, list or special id&#8217;s and classes.</p>
<p><strong>IE-styles.css</strong> is of course, for your css rules that manage the Internet Explorer bugs. This all ties into the <a href="http://www.killersites.com/blog/2006/ie-conditional-comments-video/">IE Conditional comments</a> strategy.</p>
<p>You may need another ie-styles.css to deal with specific versions of IE. For example, you may have an ie6-styles.css. But thankfully, this is becoming less and less likely since IE6 use is falling fast. </p>
<p>Thanks for reading,</p>
<p>Stefan Mischook</p>
<p>www.killersites.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.killersites.com/blog/2008/how-to-organize-css/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Automatic Table Styling with Javascript.</title>
		<link>http://www.killersites.com/blog/2008/automatic-table-styling-with-javascript/</link>
		<comments>http://www.killersites.com/blog/2008/automatic-table-styling-with-javascript/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 13:18:16 +0000</pubDate>
		<dc:creator>Stefan Mischook</dc:creator>
				<category><![CDATA[Ajax - Javascript]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.killersites.com/blog/2008/automatic-table-styling-with-javascript/</guid>
		<description><![CDATA[A while back a wrote a JavaScript script that automatically styled an HTML table. In a nutshell, the script automatically changes the background color of every 2nd row in an HTML table. 
Anyway, someone recently sent me an updated version of the script. You will probably want to read the original article before looking at [...]]]></description>
			<content:encoded><![CDATA[<p>A while back a wrote a JavaScript script that <a href="http://www.killersites.com/articles/articles_zebraTables.htm">automatically styled an HTML table</a>. In a nutshell, the script automatically changes the background color of every 2nd row in an HTML table. </p>
<p>Anyway, someone recently sent me an updated version of the script. You will probably want to read the original article before looking at these changes.</p>
<p><strong>From the email:</strong></p>
<blockquote><p>
I did some simplification on the code for zebrastripes. I don&#8217;t bother with the last array bit because TR elements have the bgColor attribute.</p>
<p>          trs[i].bgColor = ( i &#038; 1 )  ? stripe_colour_even : stripe_colour_odd;</p>
<p>Greetings,</p>
<p>tarjei</p>
<p><strong>The complete function:</strong></p>
<p>function stripe_table(id_name) {</p>
<p>  var my_table = document.getElementById(id_name);</p>
<p>  /* For debugging */<br />
  if ( !my_table ) {<br />
     alert(&#8221;The ID &#8221; + id_name + &#8221; is not found.&#8221;);<br />
     return;<br />
  }</p>
<p>      /* Table may have more than one tbody element */<br />
  var tbodies = my_table.getElementsByTagName(&#8221;tbody&#8221;);</p>
<p>  for (var cnt = 0; cnt < tbodies.length; cnt++) {<br />
     var trs = tbodies[ cnt ].getElementsByTagName("tr");</p>
<p>     /* Walk table row for row */<br />
     for (var i = 0; i < trs.length; i++) {<br />
        if (! hasClass(trs[i]) &#038;&#038; ! trs[i].style.backgroundColor) {<br />
              trs[i].bgColor = ( i &#038; 1 )  ? stripe_colour_even : stripe_colour_odd;<br />
           }<br />
       }<br />
     }<br />
  }<br />
}</p>
</blockquote>
<p>CIAO.</p>
<p>Stefan Mischook</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.killersites.com/blog/2008/automatic-table-styling-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What are CSS tables?</title>
		<link>http://www.killersites.com/blog/2005/what-are-css-tables/</link>
		<comments>http://www.killersites.com/blog/2005/what-are-css-tables/#comments</comments>
		<pubDate>Sat, 19 Nov 2005 15:23:23 +0000</pubDate>
		<dc:creator>Stefan Mischook</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.killersites.com/blog/?p=47</guid>
		<description><![CDATA[Grid layout patterns are commonly used in creating software interfaces - in web design we call them 'tables'. ]]></description>
			<content:encoded><![CDATA[<p>NOTE: This article is theoretical &#8211; CSS tables are not supported by the browsers yet, and cannot be used. I wrote this article to make a few points and to expose people to lessons learned in software development: that grids are an excellent way to layout user interfaces.</p>
<p><em>Stefan</em></p>
<p>-</p>
<p>Grid layout patterns are commonly used in creating software interfaces &#8211; in web design we call them &#8216;tables&#8217;. </p>
<p>But today HTML table based layout is generally frowned upon because:</p>
<ol>
<li>HTML tables render/display content in a fixed format/style that might not display properly in certain types of browsers.</li>
<li>Tables semantic meaning is thought to represent tabular data &#8211; like a spread sheet. Thus using them for page level layout is just wrong &#8230; gosh darn it!</li>
</ol>
<p>There are other reasons why some web designers will say HTML tables suck:</p>
<ul>
<li>HTML tables cause code to be bloated and thus pages will take longer to download.</li>
<li>HTML tables will make your website less search engine friendly.</li>
<li>HTML tables will make your websites less accessible.</li>
</ul>
<p>The last 3 points are myths and should be ignored &#8211; I covered that in other articles. </p>
<p>That being said, the first point about tables imposing a fixed format/style (where formatting and structure are intertwined &#8211; that&#8217;s bad,) is very real and very important. It is  so important in fact, that I will do what I can to avoid table based layout despite the extra work and problems this can cause.</p>
<p><strong>It&#8217;s a terrible shame</strong></p>
<p>Using a grid/table to create UI&#8217;s is  intuitive, too bad that table based layouts are so controversial &#8230; but there maybe is a light at the end of the web UI tunnel: CSS table layouts.</p>
<p><strong>What the heck are CSS tables?</strong></p>
<p>From the W3C:</p>
<blockquote><p>&#8216;The CSS table model is based on the HTML 4.0 table model, in which the structure of a table closely parallels the visual layout of the table.&#8217;</p></blockquote>
<p><strong>Now in English:</strong></p>
<p>CSS tables are just a set of CSS attributes that you can apply to (probably) div tags to create a &#8216;table&#8217;. Check out this code snippet and things should clear up:</p>
<div class="codeblock">
<p>
  &lt;div class=&#8221;table&#8221;&gt;<br />
   &lt;div class=&#8221;row&#8221;&gt;<br />
&lt;div class=&#8221;cell&#8221;&gt;<br />
&lt;p&gt;Yallow!&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</p>
</div>
<p>This is an official <a target="_blank" href="http://www.w3.org/TR/REC-CSS2/tables.html#q2">W3C specification</a>, I&#8217;m not inventing anything here! </p>
<p><strong>So why invent CSS tables when we have HTML tables?</strong></p>
<p>The answer is simple young grasshoppers: to gain the advantage of table based layout while avoiding the problems (mentioned above) with HTML tables:</p>
<ol>
<li>HTML tables format content in a fixed structure that might not render properly in certain browsers.</li>
<li>Tables semantic meaning is thought to represent tabular data &#8211; like a spread sheet. Thus using them for page level layout is just wrong.</li>
</ol>
<p><strong>CSS tables can&#8217;t be used in any browser today, so why mention them?</strong></p>
<p>I have two reasons why I wrote this article:</p>
<ol>
<li>To educate people of this long term possibility and maybe to start stirring things up &#8211; it would nice to have this web design tool.</li>
<li>To make a point about grid based layouts:  they have merit and should be considered.</li>
</ol>
<p>Stefan Mischook</p>
]]></content:encoded>
			<wfw:commentRss>http://www.killersites.com/blog/2005/what-are-css-tables/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>
