Jump to content

XHTML and Tables


Gr3

Recommended Posts

I am requesting somewhat of an explanation of XHTML Strict. From what I have seen in websites that are XHTML strict there are no use of tables from a web page that appears to use tables to layout. What I have seen is the extensive use of the "<div>" tag. Is this the newest practice for laying out content? Also I have become very use to specifying exact dimensions for tables such as height and width, which come up as errors when validating the code. My estimation is that this info is now contained in a css file. Is this true?ThanksGerard

Link to comment
Share on other sites

Pretty much.Tables are used to present 'tabular' data. (ie: info from databases which are 'tabular' by nature) It is no longer acceptable for 'structuring' pages. Well, it works, but div's are the preferred method to use in standard compliant pages.xhtml strict is also not very forgiving about its syntax. Tags must be closed, etc.Use margins and padding instead of 'spacer gifs' and br or p tags.All stuff you can learn through the Tutorials.

Link to comment
Share on other sites

I am used to designing the layout of the website with tables, now I hear that it's not the best way? Somebody pl. tell me what's the drawback in using tables?Thanks.I am used to designing the layout of the website with tables, now I hear that it's not the best way? Somebody pl. tell me what's the drawback in using tables?Thanks.

Link to comment
Share on other sites

For a humourous explanation, read this article:http://www.oreillynet.com/pub/a/network/20...ist.html?page=1CSS Layout using div's is far easier once you become familiar with the process. Tables were never intended for layout of pages, only "tabular" data should be inside tables. The emphasis is on seperating the structure and content of a page from the "presentation" of the page. CSS layout does that for you. And saves Bandwidth on your account as well. :) because most Modern Browsers cache the CSS files , whereas tables are bulky for bandwidth usage. Read more articles to fully understand it.And this article explains it even better.

Link to comment
Share on other sites

My website is completely made using tables, and I have always made my websites using tables right from using HTML in year 6, when we learnt different methods of web design.I don't personally see a problem with them even though they don't validate to strict XHTML.Anyway, where does this XHTML come in, my website was coded in HTML, I would be quite happy to start using DIVS and other things but I really don't think that I could cope because I am so used to using tables and it would take so much getting used to.And also in answer to somebodys question that was asked earlier, tables are designed for tabular data, the emphasis being on data not information!!! Search engines with often list websites that are made using tables low because all they see is tables and not much content because all of the content is in the table. Do you get me?But as I have already said, I don't see any major drawbacks with using tables. :)

Link to comment
Share on other sites

Yea. I agree. No problem with using tables. As for xhtml, the only difference there is that all the tags are closed properly, things are nested, elements are lowercased etc... My site is built with tables and it validates as xhtml just fine. So I see no point in switching to divs.
problems with using tables for layout: * mixes presentational data in with your content. o This makes the file sizes of your pages unnecessarily large, as users must download this presentational data for each page they visit. o Bandwidth ain't free. * This makes redesigns of existing sites and content extremely labor intensive (and expensive). * It also makes it extremely hard (and expensive) to maintain visual consistency throughout a site. * Table-based pages are also much less accessible to users with disabilities and viewers using cell phones and PDAs to access the Web.taken from hereno problems, eh?
Link to comment
Share on other sites

I am requesting somewhat of an explanation of XHTML Strict. From what I have seen in websites that are XHTML strict there are no use of tables from a web page that appears to use tables to layout. What I have seen is the extensive use of the "<div>" tag. Is this the newest practice for laying out content? Also I have become very use to specifying exact dimensions for tables such as height and width, which come up as errors when validating the code. My estimation is that this info is now contained in a css file. Is this true?ThanksGerard
How could i solve if there's no code?
Link to comment
Share on other sites

problems with using tables for layout: * mixes presentational data in with your content. o This makes the file sizes of your pages unnecessarily large, as users must download this presentational data for each page they visit. o Bandwidth ain't free. * This makes redesigns of existing sites and content extremely labor intensive (and expensive). * It also makes it extremely hard (and expensive) to maintain visual consistency throughout a site. * Table-based pages are also much less accessible to users with disabilities and viewers using cell phones and PDAs to access the Web.taken from hereno problems, eh?
I do not agree with you there, I get all of mine for free!
Link to comment
Share on other sites

I do not agree with you there, I get all of mine for free!
You get yours for free, because yours is enough for you. However, if you had 1000+ unique visitors per day, that might not be enough.
Link to comment
Share on other sites

i have a question though, how can divs be positioned the same way as tables? columns and rows allow you to put different bits of data right next to each other? only way i can think of with divs is to use position absolute..but then centerting the website gets confusing.... but im not very used to divs, so i may be wrong.and also adobe photoshop uses tables to structure webpages created with image slicing- are they actually going against what is considered the proper way?

Link to comment
Share on other sites

i have a question though, how can divs be positioned the same way as tables? columns and rows allow you to put different bits of data right next to each other? only way i can think of with divs is to use position absolute..but then centerting the website gets confusing.... but im not very used to divs, so i may be wrong.
you can use padding and margin and float to do all that.
and also adobe photoshop uses tables to structure webpages created with image slicing- are they actually going against what is considered the proper way?
yes.
Link to comment
Share on other sites

adobe photoshop uses tables to structure webpages created with image slicing- are they actually going against what is considered the proper way?
I don't want to offend but if you are using photoshop to design you page it is going to be a nightmare to maintain. You would be better off to setout the frame of your site in CSS/XHTML and then create the necessary graphic pieces to fit into the existing frame.Just to throw this out to all you panicing about not using tables. It sounds scary at first. Believe me I flip-flopped back and forth between tables and CSS layouts for almost a year because I was so used to table layouts (used them for 4 years) but once you get used to making CSS layouts and identify the areas that will give you trouble and find how to solve them, CSS layouts are a breeze to setup and maintain.I like to think of tables vs CSS layouts in the same way as Object Oriented Programming vs Procedural Prograaming. Both methods work but you wouldn't want to code a complex game with a Procedural method, you couldn't maintain or expand it. You would be writing custom and duplicate code all over the place unlike OOP.Just my $0.02
Link to comment
Share on other sites

i have a question though, how can divs be positioned the same way as tables?
If you are actually presenting tabular data - like a spreadsheet - then, by all means, use a table to display that. If you are laying out your site look at aspnetguy's post:
Just to throw this out to all you panicing about not using tables. It sounds scary at first. Believe me I flip-flopped back and forth between tables and CSS layouts for almost a year because I was so used to table layouts (used them for 4 years) but once you get used to making CSS layouts and identify the areas that will give you trouble and find how to solve them, CSS layouts are a breeze to setup and maintain.
I, too, have problems still getting divs to work the same way I would expect out of tables. Sometimes I give up and resort to tables. However, like aspnetguy said, maintaining pages which use table-based design can be a nightmare! I can't tell you how many times I've taken over someone elses code and had to resort to turning on and off colored borders on all the tables just to see where one piece of content is. With divs, it's all well organized. And it gets easier the more you do it.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...