Jump to content

Recommended Posts

I recently read a post somewhere online and one "senior poster" mentioned to somebody that he shouldnt use tables, im just wondering does this mean tables are becoming deprecated or is it personal favourites? Also im not sure if this is in the correct board  :o

Link to comment
https://forums.phpfreaks.com/topic/108708-web-standards/
Share on other sites

There was a thread about this a while back -- can't remember exactly where.

 

But basically, the short story is: 'you shouldn't use tables' is a rubbish statement. There's very rarely such hard and fast rules. However, its considered bad pratice to use tables to align/position data. That is what CSS is for. It will allow you to modify things far easier, and gives you more control. Tables should hold tabular data.

 

That said, there are certain times (such as creating columns of data from a database) when it is far easier to use a table.

Link to comment
https://forums.phpfreaks.com/topic/108708-web-standards/#findComment-557465
Share on other sites

That said, there are certain times (such as creating columns of data from a database) when it is far easier to use a table.

That is the definition of tabular data...

 

Yeah, i guess it is. Its just think there's a slight distinction between a straight forward table of information and, say, presenting your database content in multiple columns since your using tables to achieve a particular presentation. That doesn't sound very clear at all, but i think i know what i mean :P

Link to comment
https://forums.phpfreaks.com/topic/108708-web-standards/#findComment-557479
Share on other sites

there are certain times (such as creating columns of data from a database) when it is far easier to use a table.

 

But not always, sometimes the use of div's AND tables or sometimes just divs are easier/faster.

 

For example, I used div's and a table (holding the links) in this image:

 

121259291198242.jpg

Link to comment
https://forums.phpfreaks.com/topic/108708-web-standards/#findComment-557501
Share on other sites

there are certain times (such as creating columns of data from a database) when it is far easier to use a table.

 

But not always, sometimes the use of div's AND tables or sometimes just divs are easier/faster.

 

Easier and/or faster for you is not necessarily the best solution.

Link to comment
https://forums.phpfreaks.com/topic/108708-web-standards/#findComment-557636
Share on other sites

there are certain times (such as creating columns of data from a database) when it is far easier to use a table.

 

But not always, sometimes the use of div's AND tables or sometimes just divs are easier/faster.

 

Easier and/or faster for you is not necessarily the best solution.

 

Why not? If it works, then why make it harder on yourself?

Link to comment
https://forums.phpfreaks.com/topic/108708-web-standards/#findComment-557689
Share on other sites

I figured I should explain why I believe what I said above. I think I've said all those things before, but here you go...

 

1. Separation of concerns

A webpage can be split up into three layers: content, presentation and behavior. The technologies used in these layers are HTML, CSS and Javascript, respectively. You can imagine these as a ladder, the higher you go up, the richer the user experience. For instance, while an unformatted HTML document works quite well, it will be much nicer to look at if you style it using some CSS. Moreover, if you use Javascript correctly then you can further increase the user's experience. There are plenty of examples of that. For a simple one, check out my example in the "Is Javascript Crap?" poll in the polls forum. Note that Javascript shouldn't be overused or it will probably just annoy your users. With separation I mean that the those three things shouldn't ever appear together in the same file. All Javascript and CSS should be in external files. This means: no inline styles, no styles in the <head>, no Javascript directly in the HTML document. Humans often don't do things unless they personally benefit from it, so what are the benefits? First and foremost, your code will be much easier to maintain. You are always certain where the different things are stored and everything isn't all mashed up together which makes it much more easier to cope with. Furthermore, seeing as the HTML will be the only often changing data (seeing as it's the content layer), you'll want to keep as less data as possible together with that. The rest can be stored in other files which can be cached so they do not have to be downloaded every time by the user. This means that a) you'll save bandwidth, and b) the page will load faster for the user because s/he has to download less data. In other words, it's a win-win situation. You benefit, the user benefits, so there is absolutely no reason why you wouldn't do it. What does this have to do with the tables? If you are using tables for layout, then you are mixing up the first (content) and second (presentation) layer.

 

2. Semantics

Semantics is the study of meaning. Therefore, it's an important aspect to consider. As an analogy, imagine that you decided that every time you wanted to use the word "table" you would use the word "dog" instead. You would understand it, but everybody else would probably get a bit confused. It's the exact same thing concerning the usage of tables for non-tabular data. If you are using a table then you are explicitly declaring that the contents of the table is, well... tabular, and that's perfectly fine if it actually happens to be so. However, if it's not tabular, then you are using semantically incorrect markup. You might think that it doesn't really matter, because at the end of the day the output on the screen would probably be the same anyways. The problem is though, not everybody browses web pages using their eyes, some people use their ears and are dependent on screen readers, so if you are lying about what the content is, then the screen reader might not be able to interpret the markup correctly and that will probably just frustrate the users that use screen readers. Not only is semantically incorrect markup stupid, but your website is for your users so you must make sure that it's accessible for your users. Therefore, only use tables when you are displaying tabular data. It's also the exact same reason why you wouldn't write an essay in a spreadsheet such as Microsoft Excel.

 

3. Bandwidth

I touched this in point one. Using tables will often generate more HTML markup which means that you will have to transfer more data which leads to slower loading pages.

 

 

So, separation of concerns, semantics and bandwidth. I'm sure one could find additional reasons why utilizing tables for layout is bad. Remember and use what was just explained and you'll score some easy geek points, but if you use tables for layout, then you'll have a bazillion geek points deducted.

Link to comment
https://forums.phpfreaks.com/topic/108708-web-standards/#findComment-557835
Share on other sites

just to put in my note

my web desigh class my teacher has us do it all in tables (but at home i am now doing it in divs)

heres the wesite he did for the school http://www.choctawindians.net/

i dont really like hime that much he is really crappy  with xhtml and doesnt really use css that much

Link to comment
https://forums.phpfreaks.com/topic/108708-web-standards/#findComment-557861
Share on other sites

just to put in my note

my web desigh class my teacher has us do it all in tables (but at home i am now doing it in divs)

heres the wesite he did for the school http://www.choctawindians.net/

i dont really like hime that much he is really crappy  with xhtml and doesnt really use css that much

 

Judging by that site, your teacher is a hack.

 

Annoying movie that plays every time the site is loaded, which doesn't allow the user to control it in any way?

Annoying mouseover sounds for the main navigation?

A website whose actual size changes based on the rotating left column data?

A layout that's a mashup of both divs and tables?

Hell, he didn't even have the decency to write his own JavaScript (most likely because he can't).

 

Earth to teacher -- 1998 was ten years ago.

Link to comment
https://forums.phpfreaks.com/topic/108708-web-standards/#findComment-558205
Share on other sites

just to put in my note

my web desigh class my teacher has us do it all in tables (but at home i am now doing it in divs)

heres the wesite he did for the school http://www.choctawindians.net/

i dont really like hime that much he is really crappy  with xhtml and doesnt really use css that much

 

Tell your "web design" (right... ::)) teacher from me that he is a noob. Not only does it look hideous, but he just broke every "rule" I just pointed out above. That plus what Nightslyr just said.

Link to comment
https://forums.phpfreaks.com/topic/108708-web-standards/#findComment-558209
Share on other sites

I love the advanced search feature, it is sooo... advanced we got a "first" and "last" name!!!

 

Tell him to use cookies with his flash so it doesn't play every time you reload the page.

Use CSS rollover instead of javascript: http://www.findmotive.com/2006/10/31/simple-css-image-rollover/

Link to comment
https://forums.phpfreaks.com/topic/108708-web-standards/#findComment-558507
Share on other sites

I love the advanced search feature, it is sooo... advanced we got a "first" and "last" name!!!

 

Tell him to use cookies with his flash so it doesn't play every time you reload the page.

Use CSS rollover instead of javascript: http://www.findmotive.com/2006/10/31/simple-css-image-rollover/

 

That can't be bolded enough.  I hate JavaScript rollovers.  Most of the ones I've encountered either have horrible animation, horrible sound (like these), or are so simple that the use of JavaScript is unnecessary.

 

The thing I find so deliciously ironic about that site is that it violates a lot of very simple design concepts, yet this guy is being paid to teach students about design.  Where can I get a job where I can fail so horribly at what I do, yet still get paid?

Link to comment
https://forums.phpfreaks.com/topic/108708-web-standards/#findComment-558610
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.