CSS Vs Tables - Webmasters - Nairaland
Nairaland Forum › Science/Technology › Webmasters › CSS Vs Tables (7071 Views)
| CSS Vs Tables by OmniPotens(op): 4:50pm On Jan 02, 2009 |
So, exactly how bad are tables for website design? The short answer: Pretty bad! What do you think about it? All arguments should be backed with facts even samples where applicable ![]() |
| Re: CSS Vs Tables by yawatide(f): 4:56pm On Jan 02, 2009 |
I wouldn't say "pretty bad" as tables do have their place. they are bad when you are using it for layout and not for presenting tabular data, the former being able to cause you to embed table upon table and even worse if you are not the indenting type All samples I would point to are in my free ebook ![]() |
| Re: CSS Vs Tables by scottN(m): 5:02pm On Jan 02, 2009 |
CSS approach is preferred to tables because CSS has an OOP(Object Oriented Programming) approach to web devpt than tables such as Encapsulation and Inheritance and to an extent Composition. Also the OOP concept allows for easy management of codes. Tables should be used basically to display tabular data. |
| Re: CSS Vs Tables by Afam4eva(m): 5:06pm On Jan 02, 2009 |
Yeah, Tables are really bad when compared to CSS |
| Re: CSS Vs Tables by smartsoft(m): 5:19pm On Jan 02, 2009 |
everyone knows the importance of CSS when it comes to internet but when creating CSS website it should be neat and pretty hope more people inbibe the use of CSS to all project they start working on this 2009 and be sure to test them across the whole browser oo not just IE because something you've done IE might not come out perfect on FF or other browser, just from experience, my2cent knows what am talking about, |
| Re: CSS Vs Tables by yawatide(f): 5:46pm On Jan 02, 2009 |
ScottN If you have a table that is say, 5 rows and 5 columns, which would you prefer? Floating a bunch of DIVs or using a straight up TABLE tag that does what it was intended to do: present tabular data? Think about it. afam4eva I think tis best to support such blanket statement claims with examples. Just my opinion. |
| Re: CSS Vs Tables by OmniPotens(op): 9:30pm On Jan 02, 2009 |
@yawa-ti-de Thanks for coordinating the thread on my behalf. There are more to these reasons which have been pointed out here. Using tables to present tabulated data is ok. Any other reason why we should go for CSS rather than Tables? |
| Re: CSS Vs Tables by scottN(m): 9:34pm On Jan 02, 2009 |
When u use CSS, design changes could be made at one point i.e the CSS file and it cuts across d whole components in the app so u don't have to go page by page to make changes. |
| Re: CSS Vs Tables by OmniPotens(op): 9:54pm On Jan 02, 2009 |
Nice point. Very much like template. You call on the DIV "id" or "class" and reuse the formatting at random. Just an interesting feature of CSS. |
| Re: CSS Vs Tables by yawatide(f): 10:22pm On Jan 02, 2009 |
that is correct scottN but again, I think you miss my point which is - what are tables for? Let me use an example (assume all necessary divs are floated): A) <div id="container"> <div class="one">1</div><div class="one">1</div><div class="one">1</div><div class="one">1</div> <div class="one">1</div><div class="one">1</div><div class="one">1</div><div class="one">1</div> <div class="one">1</div><div class="one">1</div><div class="one">1</div><div class="one">1</div> <div class="one">1</div><div class="one">1</div><div class="one">1</div><div class="one">1</div> <br style="clear: both;" /> </div> AND B) <table id="someTable" cellspacing="0"> <tr> <td>1</td><td>1</td><td>1</td><td>1</td> </tr> <tr> <td>1</td><td>1</td><td>1</td><td>1</td> </tr> <tr> <td>1</td><td>1</td><td>1</td><td>1</td> </tr> <tr> <td>1</td><td>1</td><td>1</td><td>1</td> </tr> </table> Which makes more sense **semantically**? Your call. Also: Also: 1) In some cases, you have to use a TH for your table headings. Sure, this could be done in the DIVs but that would require styling. 2) the above assumes all cells are the same width. If not, you have to declare even more classes 3) overuse of classes and DIVs in css is called "classitis" and "divitis" respectively - very bad diseases ![]() 4) I see huge maintainnability issues |
| Re: CSS Vs Tables by OmniPotens(op): 10:40pm On Jan 02, 2009 |
Tabulation is tabulation no matter how its design is framed to look. That's my understanding and stand here. Needless for those excess divs while table is what is meant to do the task. Because we learnt about the use of divs should not impart a different orientation in our heads that tables should go into extinction. Tables for tabulation and not divs and spans and classes (using them= working harder instead of smarter). ![]() |
| Re: CSS Vs Tables by Nobody: 5:14am On Jan 03, 2009 |
I was reading in a forum yesterday where some experts were discussing this "those guys were so tech that even me i have to keep quiet and watch" - they were discussing something about the box model - i know a little about this - the box model has to do with how web elements such as tables, paragraphs, DIVS and some other ones are displayed. SPAN tag is not a box element. They now went ahead to say that the table element is displayed using different box models and that different browsers interprete them differently, so if u carefully layout your table on one browser, you may find out that your site may show in slightly a different manner in another browser. That they said - is the greatest disadvantage of using a table to layout your page and they too said CSS is best. And I concur with them, i just recently upgraded my design to DIVs rather than tables. The fact is we need to move with the times, there was a time that it was frameset that was reigining, and at that time, writing crossframe javascript was a great technique then, window.parent.child1.document.forms.getElementsByTagName['input'].value - can u immagine that? just the get the value of a text box all the way from an embedded frame somewhere, but that shit is outdated now, and so are tables for creating layouts. |
| Re: CSS Vs Tables by OmniPotens(op): 10:22pm On Jan 03, 2009 |
For the past few days, I’ve been scouring the web searching for the top reasons why Cascading Style Sheets (CSS) are superior to table-based layouts when designing a website. Some web designers swear that table-based layouts are better than CSS-based layouts, while others believe that table-based layouts are ancient history and XHTML combined with CSS is the only real solution to coding a web site’s visual layout. Since we’re one of those CSS die-hards, I’ve compiled a list of 13 reasons why CSS-based layouts are superior to table-based layouts. Note: CSS cannot be used on its own to create a website - CSS is merely the tool used to style a web site’s visual information. HTML or preferably, XHTML, must be used to define the structure of a website. The List Faster page loading Lowered hosting costs Redesigns are more efficient Redesigns are less expensive Visual consistency maintained throughout website(s) Better for SEO Accessibility Competitive edge (job security) Quick website-wide updates Easier for teams to maintain (and individuals) Increased usability More complex layouts and designs No spacer gifs |
| Re: CSS Vs Tables by lagerwhenindoubt(m): 2:51pm On Jan 08, 2009 |
Well, well. i am so addicted to tables as a good layout tool, maybe if there was a Table-CSS converter, i would be a fan. Noted, all the good points on XHTML and CSS are what every designer should be heading towards. I am just hoping W3c will come up with something that matches the layout ease of tables with simple to code (columns, spans, nested td) and easy to get into. my css know-how does not go beyond fonts and hyperlinks i am afraid |
| Re: CSS Vs Tables by yawatide(f): 3:51pm On Jan 08, 2009 |
larger: CSS3 I blv already supports CSS tables. The problem? yes, you guessed right - it's not cross-browser, for now at least. |
| Re: CSS Vs Tables by Seun(mod): 1:03pm On Feb 03, 2009 |
Check out this article: Why CSS Should Not Be Used For Layout |
| Re: CSS Vs Tables by jeshurun07: 8:15pm On Feb 08, 2009 |
Hi people, please who can tell me where i can get a good book on css free. i need it bad bad |
| Re: CSS Vs Tables by Nobody: 10:46pm On Feb 09, 2009 |
Well, i am addicted to tables, though i use css for my formatings and am able to make changes site wide by visiting my css file. But i think i want to be more productive. with the help of dreamweaver & Tables, i spend less than 20 mins laying my first pages (homepage), no matter how complex the pages is. just left with dragging my images in and switching to php. I guess i must be missing something by not using CSS, pls advice. @Seun, The content of that article is one reason i did not want to come back to CSS. when you are done coding ur css, expect varying miracles in ur browsers which must always be fixed, fix it in IE, firefox tells u, "NO! you aint done yet", fix it in firefox, IE says, "why u dabaru everything na?". I respect all these our css gurus |
| Re: CSS Vs Tables by Nobody: 6:56am On Feb 10, 2009 |
The only site i have used css so far rather than tables is my site (and i regretted it later) - i still find tables better - though you will need to know how to pull some stunts to make it downgrade well on all browsers - like stripping out the cellpadding, spacing, And it does carry some advantages by allowing relative positioning and all that. I have been using it over the years and i think it is ok - afterall what we are interested in is results - and my layouts show equally in all the major browsers. I think the point here is whatever you make use of - use it well! |
| Re: CSS Vs Tables by OmniPotens(op): 8:33am On Feb 10, 2009 |
Hmm, No matter what, I think this CSS thing is just like the other programming languages. They have their flaws too but I must say that, even those that at this point critique it, sooner or later will have to uphold it else they make their own standard and implement on their own browsers. All I see here is a mastery of the CSS techniques and you are working your way through it. I've used and worked my layouts using CSS and it has been compliant. One thing people might tend to look at while disliking CSS is their not knowing some hacks of CSS which help to make them compliant with IE, FF, Opera etc. An example might be the issue of .png and .gif usuage. If you don't know the tricks to make this compliant on all browsers, it might display well in one and alter in another. This same thing goes for a language like say Ajax. To make it compliant on all browsers, you code to check compatibility on all browsers then give a default action. There are more to this but all I can say is, learn CSS, practicalize and implement it and you'll ever love it. |
| Re: CSS Vs Tables by yawatide(f): 9:33am On Feb 10, 2009 |
The more you code with CSS/Web Standards, the more aware you become of cross-browser issues. It's just, as omnipotens says, like learning any other language. So come on folks, stop being lazy. Go with the flow! ![]() |
| Re: CSS Vs Tables by WebMonk(m): 2:57pm On Feb 10, 2009 |
Seun:I read your post. True. However, what ever hitches the article pointed out (which can be fixed, given 'liberal creativity', as he stated) do not in a any remote significance taint the benefits of using CSS for layout. tables have their place, and grasping CSS isn't exactly for the tabular oriented, but as someone said but it's the solution, not the problem My Sample 3-Column-Layout-Code |
| Re: CSS Vs Tables by ikeobidi(m): 7:53am On Feb 11, 2009 |
Tables aren't that bad, once u've mastered them. Besides, css can be implemented excellently on tables. |
| Re: CSS Vs Tables by yawatide(f): 1:17pm On Feb 11, 2009 |
ikeobidi, tables are bad for layout. Period! Tables are for, as the name implies, tabular data. Have you ever tried making a change to a 7-layer deep table, with no indentations? I have and I can tell you it isn't fun, not to mention all the unnecessary code and weight it adds to a page. |
| Re: CSS Vs Tables by kehers(m): 3:33pm On Feb 11, 2009 |
This is a topic developers won't stop arguing about. Personally, I go with the idea that CSS are better for layouts while tables should go for tabular data. But that's just me and then again it depends on the complexity of design. Pause for a minute and visit your favorite site. View the source and search for "table". It will be there in use - for layout and not tabular data! No? Browse through 5 more pages of the site and you will find out it is. Google, Facebook, Mozilla labs, just name it. Like I said, it depends on the design. If it is a simple one with very little layout structuring CSS is fine. But if it is a bit complex, tables will have to come in - @lst for me . Or how do you think facebook do the rounded cornered shadow effect those in-browser popup boxes have? |
| Re: CSS Vs Tables by Nobody: 7:38pm On Feb 11, 2009 |
I wonder why this argument is going on at this age, when the whole world have switched to CSS as far back as 1999. Are Nigerian developers so backwards? Please check out the w3c website regularly to keep yourselves updated with the latest w3c recommendations. Cheers! |
| Re: CSS Vs Tables by yawatide(f): 8:10pm On Feb 11, 2009 |
cnario, They aren't backwards just, generally speaking, people who want to do less work for maximum pay. At the end of the day, the average client probably doesn't view source or even tell them what they want. They want a website and don't care how it gets done, not to mention load testing, etc. The average developer in Nigeria (and I say with from chatting with quite a few and from reading posts on this board) just wants to upload their site, "clean mouth" and move on to the next thing. Which is easier? Typing out (or having DW do it for you) a series of embedded tables and knocking out a website in a few hours or learning the box model and why it can be so frustrating for developers? Using a tried-and-true tables or "wasting" time figuring out "this yeye CSS sef"? The lazy me would go for the latter in both cases. However as you have rightly said, the world has moved on in this regard, since 1999 and it is best to stay with the flow and stay up-to-date. |
| Re: CSS Vs Tables by Nobody: 10:00pm On Feb 11, 2009 |
yawa-ti-de:Laziness is the worst thing that can happen to anyone that calls himself a designer/programmer. Do they actually know the implications of using outdated codes? At the end of the day, It's hard work to work with outdated codes, cos they won't validate, as against the latest recommendations. Moreover, I wonder when quality service will become the first priority of our people, rather than just taking their checks and running after the next project without even caring if they've done what's best for the client. it doesn't matter if the client knows it or not, but it always catches up with them one way or the other, their laziness will be made evident in all their jobs, and eventually on what they think they know, their knowledge will simply become extinct. As it stands now, there's a lot of things going on concerning web standards, and my advise to anyone that wants to remain relevant is to BEND DOWN AND WORK. Cheers! |
| Re: CSS Vs Tables by Nobody: 8:32am On Feb 12, 2009 |
Guys guys guys, take it easy. tables are not outdated. I know u all are css gurus but hey, using alternative is not bad. Just like i think ASP sucks compared to other languages, and i dumped it does not mean I should start a campaign on how bad ASP is yawa-ti-de:I have been busy getting my hands wet with 3d modelling, and let me share a tip with u yawa. when you need to build a human character, and animate him, you need to rig and skin him. rigging is the art of making ur character appear and move as if it is real how this is achieved? you can add influence objects below the skin to make it appear as if it has volume when deforming the character in other words, those dangerously crashing vehicles producing that heavy bang sound might be empty. where am driving to is this? what people want is a website that load fast, displays well, scripted to do the required tasks. nobody cares if you achieved that with tables or windows, nobody. they dont even want to know u used dreamweaver or notepad, or php or asp tables or css, it depends on you I have asked you to tell me what am losing by using tables and not css, you have said nothing in this regard cnario:please show me where w3c is saying that |
| Re: CSS Vs Tables by Nobody: 8:50am On Feb 12, 2009 |
webdezzi:Please log on to the w3c website and browse through their archives. There are tons of articles on this issue. |
| Re: CSS Vs Tables by Nobody: 9:23am On Feb 12, 2009 |
cnario:now i see, Articles u said, articles are not facts my dear. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">Thats the http://mail.yahoo.com login page. whoever worked on that simple page used 4 tables - 2 of those were nested. check the code for the busy yahoo homepage - it has just 1 table, the team who worked on that had "guys, this is a css page" in mind Like i said, it all depends on ur style. If u care to know, i dont nest tables, i use css when i feel i need it, and i use tables when i need it. IMHO http://www.webdesign.org/web/html-and-css/articles/there-is-nothing-wrong-with-using-wysiwyg-editors-if-you-already-know-how-to-write-html.4974.html some people think because a chair has an arm, you must always put you hands on those arms and sit like a king, No. dreamweaver has a code-view, more like your much appraised notepad, and helps you when coding, like wrong syntax highlighting, broken code highlighting, tags completion, code coloring. for instance when u type < div classs=" it automatically loads your pre-defined classes so u can choose which of 'em you know i still wonder how long it takes to locate broken codes in notepad. |
| Re: CSS Vs Tables by Nobody: 9:54am On Feb 12, 2009 |
Correction - Articles and papers published by the World Wide Web Consortium (the organization in charge of setting web standards). I don't think you understand the issue. W3C is not saying that tables are outdated, their advice is to avoid the use of tables as much as possible in your layouts. The major reasons are : 1. search engine crawlers have issues with tables, as against CSS sites which they find very friendly - they crawl DIVs with ease. The point actually is removing mark-up from presentation as much as possible. Here is how it works, search engines crawl billions of websites in minutes. When they enter a website, and find lots of mark-up, they leave, because they just hate the damn MARK-UPs. CSS tries as much as possible to remove as much mark-up as possible from your site, leaving only presentation. That is just a brief summary I won't go into details here. 2. well structured CSS sites will validate, while tables won't. Have you wondered what this validation means? , if you don't know that as a webmaster, then it's a pity. I won't write more on this issue. I'm just trying to give a friendly advise. EDIT: Did you even go through the codes you pasted? Most of the presentation are done in CSS - that's what W3C is saying. "Use TABLES only when you can't avoind it. But if you can, avoid it completely in your layout." |
Write HTML And CSS Codes On Android Devices • How To: Create A Simple Hover Button With Html And Css • CSS Vs Tables • 2 • 3 • 4
5 Reasons To Start A Blog If You Are Passionate About Writing in 2017 • 5 Reasons You Should Start Your Blog This New Year • I Have Got The New Mtn Code For Making Calls Free To All Network


