5 Replies - 2024 Views - Last Post: 22 February 2007 - 09:28 PM

#1 fyrestorm  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 10
  • View blog
  • Posts: 3,113
  • Joined: 04-April 02

CSS vs Tables

Posted 23 January 2007 - 01:03 PM

I am preparing an argument for why I should be able to use css + divs instead of tables for a class assignment.

The professor is really stuck on us using tables.

My initial thought is because css+divs are the current web standard

Where I need help is 2 places:
1) Documentation to back up my thoughts
2) Other thoughts why tables are bad and css+divs are the way to go

Any help in this matter would be greatly appreciated.


Is This A Good Question/Topic? 0
  • +

Replies To: CSS vs Tables

#2 MarkoDaGeek  Icon User is offline

  • Dirty Technophile
  • member icon

Reputation: 14
  • View blog
  • Posts: 11,158
  • Joined: 13-October 01

Re: CSS vs Tables

Posted 23 January 2007 - 01:29 PM

I guess the only way to prove that divs are overall a better solution is to develop some sort of page or mini site that shows them side by side, and shows HTML table's weakness compared to the current standard.

I've seen this before with technology instructors, the problem is that they teach the same ways of doing things for years, they know how to teach it, they are good at doing it etc... They don't update their methods with ever changing technology.

I think you should battle to the death, teaching an old technology or way of doing something like that isn't going to prepare someone for work in the field, and that's supposed to be what your paying for.

My entire Cisco education was based around old Catalyst 1900 switches and 10baseT 2400 series routers... and then I move onto the "standard" 3600 series that are being used now, such as my work, and it's this huge change where I have to re-learn everything.
Was This Post Helpful? 0
  • +
  • -

#3 capty99  Icon User is offline

  • i am colt mccoy
  • member icon

Reputation: 99
  • View blog
  • Posts: 10,081
  • Joined: 26-April 01

Re: CSS vs Tables

Posted 23 January 2007 - 02:31 PM

check out the first page of w3schools css tutorials. good reasons why to learn. and a couple html bashings.

from w3schools :


Styles Solve a Common Problem

HTML tags were originally designed to define the content of a document.
As the two major browsers - Netscape and Internet Explorer - continued to add new HTML tags and attributes (like the <font> tag and the color attribute) to the original HTML specification, it became more and more difficult to create Web sites where the content of HTML documents was clearly separated from the document's presentation layout.

To solve this problem, the World Wide Web Consortium (W3C) - the non profit, standard setting consortium, responsible for standardizing HTML - created STYLES in addition to HTML 4.0.

All major browsers support Cascading Style Sheets.
Style Sheets Can Save a Lot of Work

Styles sheets define HOW HTML elements are to be displayed, just like the font tag and the color attribute in HTML 3.2. Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in your Web, just by editing one single CSS document!

CSS is a breakthrough in Web design because it allows developers to control the style and layout of multiple Web pages all at once. As a Web developer you can define a style for each HTML element and apply it to as many Web pages as you want. To make a global change, simply change the style, and all elements in the Web are updated automatically.

Was This Post Helpful? 0
  • +
  • -

#4 omochan  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 6
  • View blog
  • Posts: 148
  • Joined: 19-October 06

Re: CSS vs Tables

Posted 20 February 2007 - 09:29 AM

Seems like the above poster hit the nail on the head FTW :)

As a person who transitioned from table-based layouts to css+divs, I have to say that the first poster hit the nail on the head, too.

Tables are good for display data that goes in a table, but not for much else. Mostly because there are fewer limitations on what you can do with CSS and there is significantly less markup per webpage if you just pre-define the styles with stylesheets.
Was This Post Helpful? 0
  • +
  • -

#5 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: CSS vs Tables

Posted 20 February 2007 - 10:07 AM

Why a CSS layout will make you money - dunno if he is right, but interesting anyway :)

And this one touches all main reasons that came to my mind.

Anyway, CSS is nice, but can be a pain sometimes, and much harder to teach, as some browser bugs are quite hard to pinpoint and even more difficult to find a comfortable workaround. So I can understand the instructors, but hopefully table layouts will become history soon (frames anyone?).

Go ahead and prepare for war!
(and show 'em csszengarden to make something like that with tables)
Was This Post Helpful? 0
  • +
  • -

#6 Arbitrator  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 530
  • Joined: 26-January 05

Re: CSS vs Tables

Posted 22 February 2007 - 09:28 PM

I wouldn't be surprised if the reasons for teaching tables have to do with it being easier to teach (one syntax instead of two) and browser incompatibilities. I would think it even more so if teaching the students to use an editor (bad) instead of the language (like they should be) since it would be easier to teach how to make a table layout in such a context and harder to explain why the WYSIWYG editor view ends up being inaccurate in the real world.

The reasons why I would vouch for CSS are:
1. Separation of style (CSS) and structure (usually HTML). It makes code more readable and thus easier to troubleshoot and work with.
2. As a result, the code is more easily maintained:
  • For one, changing one file allows for site-wide changes.
  • For two, you can perform repetitive actions with less code. Want all paragraphs to be italicized or specific font? No need to repeat an i or font element over and over and over.
  • For people that aren’t familiar with one of the languages (CSS or HTML) or both, it’ll probably be easier for them to figure out how things work and make edits.
3. More functionality. CSS can do things that HTML cannot. Automatic text indentation, hyperlink hover effects, small-caps, line-height adjustments, border styles, background positioning, opacity, etc. CSS also lets users alter a page without touching the HTML (think MySpace, forums, blogs, etc.).
4. Alternate style sheets. You can offer alternate style sheets for the disabled such as those with poor vision or color blindness or for those that simply like having an alternate color scheme or theme. For example, Firefox lets you use View > Page Style to switch to any alternate style sheets. CSS also offers other accessibility advantages such as fall-back fonts or scalable spacing (think em units).
5. Portability. CSS transfers to languages such as SVG and XML, meaning that you only have to learn a style language once.
6. Professionalism. HTML and CSS go together; I don’t think any one will take you seriously saying, “I know HTML,” if you don’t know CSS, except those other people that don’t know HTML. The two languages are pretty much inseparable.

Reasons why tables are bad:
1. They require more markup. This increases file size and lessens readability.
2. They load more slowly as both a consequence of the former, but also because of their nature. A table is a framework and a browser wants the framework downloaded before rendering. Rendering itself takes longer.
3. They’re linear. Want that left column on the right? With a properly coded CSS-based layout, you can do this by editing as few as two declarations (or lines, in visual terms). And you can do it site-wide too. Not as easy with tables.
4. Tables are a framework, so if edit part of it, you tend to have to edit the rest of it. For example, if you add another column, you may have to increase the value of numerous colspan or rowspan attributes.
5. Ease of use. A problem that I see frequently with tables is that the dimensions do not add up. People simply have a hard time using them despite those same people calling them easy. For example, they don’t add margins + borders + padding + width + (border-spacing×cells + 1). It doesn’t help that tables use the old box model, as per CSS, which is inconsistent with even CSS-based tables.
6. Proper use. The use of tables for layout is not semantic. They’re meant for tabular data, such as baseball scores or a list of the world’s tallest buildings.

Okay. That’s enough for now. (Too much typing for one post. :P)

P.S. I have an Intro. to Computers instructor (was forced to take the class) that taught code like this; we had to create a Web page and I ended up making mine a critique of his assignment and how it was wrong.

This post has been edited by Arbitrator: 22 February 2007 - 10:33 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1