My BlogAbout MePortfolioTemplatesArticlesWeb StoreMessage Board (Forums)Guestbook

Browse archives

September 2012  
Mo Tu We Th Fr Sa Su
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Search this site with Google

The problem with CSS and why designers think with tables

Submitted by Jakob on 30 June, 2006 - 21:51.My Blog | CSS | Human-Computer Interaction | Usability | Web Design | XHTML

So called web standards-compliant coding using XHTML and CSS is being touted as the way of the future for web design and more and more people adopt the new methods and practices by the day. However CSS introduces a less than intuitive way to think about page layout which makes it hard to adopt and is also why web designers still use tables for layout. In this article I will cover some recent web design history, discuss why designers think with tables and why the CSS formatting model is not as intuitive as it should be.


The first ten years of design on the World Wide Web

The Internet has seen an explosive growth, from being an underground phenomenon to becoming something everyone in the industrialized world depends on in one way or another. One of the most used Internet technologies is the World Wide Web, or just the web which consists of millions of web sites and documents all coded in the document markup language known as HTML. In fact you are using the World Wide Web right now to display this article.

The use of HTML to build web sites has changed dramatically ever since its inception some 18 years ago and its development was during its first ten years controlled by web browser software designers rather than the standards created by the World Wide Web Consortium, an organization founded to define and promote standards for the WWW. The result has been that browsers have interpreted HTML in very different ways which has caused an endless headache for people whose job it is to design web sites and make sure information is presented consistently online.

The hypertext markup language, or HTML, is a way to classify and structure information in order to store and share it. This markup language has one very interesting property, which for a long time in the early pioneering days of the web went largely unnoticed. This property is called semantic classification and allows you to classify information based on its meaning. A properly marked up document will have all text considered to be headlines marked as headlines. A headline is more than a line often in bold, large font, it also has a different meaning compared to a paragraph, and this distinction can be coded in the HTML.

When HTML was thought out and implemented at the CERN research facility in Switzerland in the late 80s there was no need for advanced text formatting, or any need to do graphic design. It was designed for a small system, intended to be used by the researchers alone. As HTML and the World Wide Web were introduced to the general population the needs changed. People wanted fancy, attractive websites that were colorful, had different type faces (or fonts) and images embedded a lot like the magazines they were used to reading. In order to satisfy this need, web designers were forced to be creative using what little HTML offered in terms of graphic design. Browser software designers and manufacturers such as Netscape and Microsoft, were quick to give them what they wanted and soon there were tags (pieces of code) to set the font face, size and color and even create blinking text. Microsoft decided to omit support for the latter, by some people sardonically commented to be the only positive contribution Microsoft has even done to WWW technologies.

Tables, formerly a web designers best friend

When Netscape introduced the table tag, originally intended to be used for tabular data, such as statistics, web designers had the tool they had been looking for to create page layouts and web designers started creating advanced page layouts. By nesting tables in each other and using images you could make rounded corners or create advanced layered backgrounds for elements. By using so called spacer images you could make sure elements were position the same way in all browsers, a nice way of getting around the a lot of quirky browser behavior since every browser had its own way of doing things.

Now, as some of you probably know there was a problem with this, the table tag, just like most other tags, was intended to be semantic, it was intended to reflect the meaning of the content it wrapped but was most often used for nothing but presentation. The result was that tags lost their semantic use and people who were visually impaired and relied on speech readers had a lot more problem browsing the web. Not only that, it made indexing and searching the web a lot slower and harder since search engines had to figure out what of the HTML code was meant for presentation and what was meant to be actual content.

Standards and Semantics

The web standards movement, initiated by people tired of browsers that didnt work the way standards dictated and had their own way of displaying content online, is working for the return to coding according to standards. Coding according to standards today means more than just using tags that are in the standard, avoiding proprietary tags introduced by browser manufacturers, it means separating presentation from content and use HTML for semantic classification. In order to meet the demand from designers to allow advanced graphic design on the web, CSS was developed in the latest 90�s. Standing for Cascading Style Sheets, it allows the designer to put all formatting rules in one document while storing the content in another, making sure they arent mixed and that presentation does not mix with semantic structure or vice versa.

Why CSS is a flawed technology

Cascading Style Sheets introduce a new way of thinking about how a pages layout is constructed, it introduces several key terms that refer to how an element on a web page is position in relation to another. I will not explain CSS in this article as it is beyond its scope, but suffice to say the design thinking behind CSS is not like that of traditional graphic and print design, or rather intuitive either for that sake. CSS was created by software engineers, and with all due respect my dear programmers and Linux kernel freaks, software engineers generally do not do good design or understand how to best present information in an aesthetically pleasing and usable manner. The result was that CSS became hard to grasp, hard to learn and even hard to implement.

It would appear that CSS is inherently flawed in several aspects and the design and implementation of CSS was done without considering usability, information design or cognitive psychology. In short what we know about how people perceive, structure and design information was disregarded when CSS was thought out and the specifications for it were written. The CSS formatting model is poorly abstracted as it is based on how the browser works technically and how browsers are coded and designed to interpret and display web pages instead of how pages are designed and used.

The whys of the popularity of tables and grids for layout

Despite their shortcomings, tables were popular for several reasons. First of all, layouts based on tables displayed surprisingly consistent in different browser and across different platforms. But secondly, Ill argue, most importantly, tables were more intuitive and represented a thousands year old way to think about the display of printed information. Designers loved tables because it allowed them to work the way they were taught, schooled and used to think about page layout and text formatting.

Using tables it is very easy to create a so called layout grids, a text layout which can be observed in ancient Egyptian scrolls and in the first books printed by Gutenberg. Using grids for layout isnt just something that we have done for thousands of years, it is a design pattern we learn the day we see printed media, not to mention learn how to read and as such affect not only how designers think but also how every member of a modern culture thinks. In fact, grids seem to be the most fundamental principle of human structural layout.

Yet, ironically, creating a layout grid with CSS that works across browsers is an enormous challenge that has taken hundreds of attempts and several years to manage. There are several reasons as to why it poses such a challenge for a traditional print media designer.

  • First of all, understanding CSS well enough to create this, the most basic of all graphic design patterns isnt easy, it is hard, you need to understand a way to position elements that has very little to do with classical graphic design. CSS works this way, contrary to design intuition; it was built this way even though the people who are meant to be using the technology are indeed designers.
  • Secondly, since the Internet Explorer browser was developed according to broken and incorrect models of how CSS works, it will also require an understanding of cross-browser CSS rendering.

The future of web design

Despite its flawed implementation and design, CSS allows us to effectively separate content from presentation and build a semantic web where information is structured in a way that makes it accessible, transferable and indexable and provides a storage format that is future-proof. This an enormous benefit as it makes the Internet more usable and more valuable.

Considering this, traditional HTML tables are not an option, they are not suitable as they are not compatible with the semantic web. What is necessary now is to rethink how CSS should work and extend the CSS standard to allow designers to use CSS to quickly and easily build grid-based layouts in an intuitive, natural and effective way instead of forcing them to learn a formatting model which is the result of poor abstraction, a model that is based on the technical implementation of a browser rather than how web pages are designed in reality.

Cascading Style Sheets already offer ways to display elements arranged like tables, something much akin to how grid layouts and constructed, but it is not yet supported by Internet Explorer, that browser that most web designers love to hate. In order to make the semantic web a reality and spearhead the future of the semantic World Wide Web, making grid layouts with CSS must be easier and must be better supported by browsers and standards.



Trackback URL for this post:

http://www.jakob-persson.com/trackback/477
Submitted by DoubleJ (not verified) on 2 July, 2006 - 11:07.

I always enjoy reading these kind of articles, and now it also makes a bit more sence, why I like css based layouts more then table layouts.

I am a 'programmer' so in a certain way I think more like the 'browser' rather then how a designer would thing(not to good at that still).

From what I've now heard from IE7, it will better support standards but will not be perfect yet.

Let's just hope that microsoft finally gives up controlling the browser market and starts to support standards as they should.

Back to css, I have never worked with both css2 or 3(?) aren't there any kind of improvements regarding how they work from a designers view?

Submitted by Jakob on 2 July, 2006 - 22:17.

Back to css, I have never worked with both css2 or 3(?) aren't there any kind of improvements regarding how they work from a designers view?

I haven't worked enough with either to give a definite answer but CSS2 includes support for "display: table" which allows you to make DIVs behave like TD tags, which makes a lot more sense from a designer's point of view, and doesn't break semantic classification. It still isn't a "fix" as the CSS visual formatting model is inherently flawed in its implementation and I'd rather see a total overhaul though I consider that happening very unlikely. :)

Submitted by Will (not verified) on 10 August, 2006 - 02:53.

I think css is great. It's missing what you describe: Grid based layout techniques but I wouldn't throw the baby out with the bath water. That needs to be added, for sure, but why get rid of the elegance of the cascade and similar core ideas? They're brilliant and can be DEVICE INDEPENDANT. That last bit will be key and the geeks realized it long before the designers.

Nice write up and nice site design.

Will

Submitted by Jakob on 10 August, 2006 - 15:33.

Yes I agree, and that is also my conclusion. CSS is a flawed tool in its current implementation since it makes it hard to create the most basic of layouts.

I love the device independence and that it allows you to serve different stylesheets to different device types. In fact I plan on offering a phone and handheld version of this site, as well as a printable one, I just haven't had time to do it. I also love the clean structured markup, it's the right way to go.

Submitted by DJDevon3 (not verified) on 1 September, 2006 - 21:01.

Spot on. I think the current CSS model or even 2.0 sucks. I was used to table design long before CSS was available. I use CSS now and am descent enough to do what I need with it but like you I stil use tables because building with divs and spans is far to complicated. Absolute and relative positioning seems like it was created specifically for dreamweaver or other types of wysiwig programs. I've only used it in a few instances and it's hardly something I need.

The W3C are indeed a bunch of engineers and not designers. I think they build the code just to serve their own dinky little projects like hmmm why can't I get this in position A. Oh I know, I'll just write it into HTML 4.0 yey! Seriously though, CSS2 implementation isn't going to impress me much. I'm waiting around for something that will act like tables such as the div style: table mentioned above or anything equivilent. All designers are used to tables but even tables are badly flawed in some browser such as there is no 100% height or autoflow height. I would much rather have them fix the existing issues and move on from there instead of switching up the code on me every year and I have to relearn how to write html or css.

Yes, I agree that CSS provides an excellent feature set to accompany HTML. Holding style information to be reused and recalled more efficiently will make the world a better place but it has to be done right and currently it's not right. I'm frustrated on a daily basis with illogical names of attributes mostly. Like background-color, background-image, background. Who cares! Just make it 1 thing, background! Period, done, finish, nothing more to see here. All inclusive tags are what made html so great. Hmmm and another one CENTER. How much more complicated do you want to make it for newbies trying to center something. They are going to deprecate center omg. That was the easiest tag in the world next to br. Now I'm going to have to do text-align: center; in css. These are the frustrations of myself and all designers the world over. I'm not normally negative but when it comes to the W3C running my coding life I want to throw a lemming off a cliff. I'm sure you're frustrations are the same which is what prompted you to write that article. Do you think they hear us or are they just doing their own thing with disregard. I mean what can we really do about it other than voice our opinions and frustrations. If they want to ignore they can easily do it because after all they are making the standards not us. I would like to take a ruler to every W3C members hands and ask them what the heck they were thinking when they came out with transitional code. I'm tired of transitional just give me the good stuff. The stuff we all want and deserve and that will take the web to the next level.

Submitted by Jakob on 2 September, 2006 - 14:13.

Thanks for your comment.

I don't agree fully with you. CSS offer two concepts derived from object-oriented: specificity and inheritance, both offer a lot of power to designers to control document style through the differents levels of the DOM (document object model).

I'd never trade anything for the logical and structural benefits offered by CSS, I'll never go back to HTML 4 table layouts. I think a lot of the criticism of CSS comes from lack of knowledge about how it actually works, and CSS isn't easy to learn or grasp which is another of its shortcomings and flaws. Its core problem is that it makes something that should be very easy, become indeed very complex. Part of that wish to support power through simplicity, I wish CSS made it easier to make grid layouts that work consistently in all browsers.

Regardless of the problems I point out, CSS has revolutionized web design and helped it mature. The logical separation between content and layout CSS offers has helped millions of people take part of content they couldn't access before because of inaccessible layout.

As for my wishlist, it seems we're getting there, slowly, considering what's on the table for CSS3:
http://www.css3.info/preview/

Submitted by Chris (not verified) on 21 September, 2006 - 05:30.

That was well thought out, and I agree with you. I'm always fighting the urge to just toss CSS and go with tables because it's easier. The first problem I always have is positioning things where I want them, and I always feel like I'm cheating somewhere.

Just at a glance, though, CSS3 is looking pretty good. Eventually, it will get where we want it. :) It's a good thing that there are people who can openly criticize it in the interest of improving it. By the way, I dig your work.

Rock on,
Chris

Submitted by Roman Budowlane (not verified) on 14 October, 2006 - 18:03.

I absolutely with agree you, my website it is one example of create xhtml and CSS there respect norms W3C. But there are problems always with IE which reads CSS in another way that Firefox.
Thank you for your article very interesting.

Submitted by Roman Antyki (not verified) on 9 November, 2006 - 02:43.

I used to start ... drawing my projects with kipping in mind that thing. Now i keep in mind 's. Somehow its a little bit annoying - it's stop your creativity. Much more you've got from flash - but there is some disadvantages as well. And that differences between browsers and IE ...

Submitted by AUtobusy (not verified) on 16 December, 2006 - 16:21.
I absolutely with agree you, my website it is one example of create xhtml and CSS there respect norms W3C. But there are problems always with IE which reads CSS in another way that Firefox. Thank you for your article very interesting.
Submitted by Marc Antyki (not verified) on 9 November, 2006 - 02:48.

First tables for keeping things on website ... now div's and css ... always some restrictions if you don't wont to have 300 kb weight website.
BTW ... when browsers (not IE) will accept user font's ?

Submitted by Ant (not verified) on 25 January, 2007 - 00:41.

Talking about grids being the traditional method of design on previous media isn't that applicable IMO. For the most part with those traditional media there was a tight coupling of the content to the media it was on. There isn't any of that with the web. The web has completely broken the link between the content and the properties of what ends ups displaying it, reading it, proxying it, processing it etc.

That is a fundamental difference, and it will take adjustment for those used to traditional methods. I've known designers that haven't had any trouble adjusting and wouldn't want to look back.

One thing I think a lot of people overlook about CSS is that it isn't designed just for styling (X)HTML web pages - it is intended to be able to style any arbitrary SGML/XML like document or data format. Those formats could have completely different semantics to (X)HTML. For this reason CSS is totally independent of the semantics of the underlying content. To CSS the document is just a tree of nested arbitrary elements. Hence all the wacky values of the display property - you can turn any element into a block or inline element or even a list item etc.

As an example to come full circle: CSS already has some limited support for table like layout grids that can be applied to any elements (CSS3 looks like it improves on it though). You can have your clean semantic markup and your table layout. Just because IE doesn't support it doesn't mean that it is a failing of CSS itself.

Submitted by Jakob on 1 February, 2007 - 16:24.
Talking about grids being the traditional method of design on previous media isn't that applicable IMO. For the most part with those traditional media there was a tight coupling of the content to the media it was on. There isn't any of that with the web. The web has completely broken the link between the content and the properties of what ends ups displaying it, reading it, proxying it, processing it etc.

Not true at all. Even though theoretically the technology allows us to use any media, the media is important and will influence how people use it and think about it. Like Marshall McLuhan once said: "The media is the message". There's always a bond between the two.

The properties of the paper, the page metaphor, isn't something we can or have just done away with, it's all prevalent in our dealings with computer technology, and we bring real-world metaphors in the computer world every day. Why else do we call it a web page? Why do we browse the web with a browser? Why else do we have the desktop metaphor?

This is exactly why traditional methods of displaying and visualizing information are still needed, why people spend hundreds of hours coming up with things like YUI Grids to solve a very simple problem. Regardless, it's beside the point I am am making. My point is: the fact that making grid designs is hard with CSS is proof that CSS doesn't solve the problem is was designed to solve. YUI Grids is just another proof to support my view.

That is a fundamental difference, and it will take adjustment for those used to traditional methods. I've known designers that haven't had any trouble adjusting and wouldn't want to look back.

Yeah I am one of those, I use CSS positioning daily, haven't done table layouts in a very long time. I don't say CSS is bad or that I'd like to go back, much to the contrary, but there are things CSS should be better at.

One thing I think a lot of people overlook about CSS is that it isn't designed just for styling (X)HTML web pages - it is intended to be able to style any arbitrary SGML/XML like document or data format. Those formats could have completely different semantics to (X)HTML. For this reason CSS is totally independent of the semantics of the underlying content. To CSS the document is just a tree of nested arbitrary elements. Hence all the wacky values of the display property - you can turn any element into a block or inline element or even a list item etc.

True, and it's one of its greatest features, which I also mention in the article, still it doesn't help me do nice grid layouts for non-tabular data, regardless of sem. :)

As an example to come full circle: CSS already has some limited support for table like layout grids that can be applied to any elements (CSS3 looks like it improves on it though). You can have your clean semantic markup and your table layout. Just because IE doesn't support it doesn't mean that it is a failing of CSS itself.

Like I wrote above, assuming you read the whole article, CSS3 improves on things, it's not perfect. Once CSS lets us make proper grid layouts with semantic clean markup, I'll be happy, but we haven't gotten there yet.

IE is flawed in itself and I have never criticized CSS itself for IE's poor implementation of it, that goes without saying.

Post new comment



The content of this field is kept private and will not be shown publicly.


*

  • Web and e-mail addresses are automatically converted into links.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
Verify comment authorship
Captcha Image: you will need to recognize the text in it.
*
Please type in the letters/numbers that are shown in the image above.