September 4, 201016 yr Hi I am making a website with HTML and CSS. I wanted to make tables so I use a code like: <table> <tr> <td> Welcome! </td> <td> This is my website! </td> </tr> </table> I want to validate its HTML but HTML Validator says that it's not allowed to use the <td> tags with the DOCTYPE I am using; the DOCTYPE I'm using is <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd"> What DOCTYPE should I be using?
September 4, 201016 yr Author Nevermind I got it, my mistake was something else (in some instances I forgot to put the <tr> before opening a <td>
September 4, 201016 yr As said above, you shouldn't lay a website out in tables. Tables are for tabular data only.
September 6, 201016 yr As said above, you shouldn't lay a website out in tables. Tables are for tabular data only. I only use them for my forms
September 6, 201016 yr I only use them for my forms Why not <form>, <label> and <fieldset> tags? Surely these are a more appropriate way to represent the content? I kind of hate the whole forms and tables thing, deep down i know forms are probably tabular inputs, i just can't see that as the best approach. Try pretending to be blind, would you much rather ask a user to insert the missing data into a table, or to fill in a form? Another consideration to make is that screen-readers read tables in a linear fashion, they read across each row in turn, this default behaviour needs to be taken into consideration when designing a form within a table. Just my $0.02
September 10, 201016 yr Author Wow I just saw all these answers, I thought my problem was fixed after my second message. What do you guys mean with laying out a website in tables? Please explain me. I discovered how to make tables and I thought they look cool on my website. I use them on my first page to write news about my website, for example each "new" has its own table. Is something wrong with that? I didn't understand what you guys mean.
September 10, 201016 yr Wow I just saw all these answers, I thought my problem was fixed after my second message. What do you guys mean with laying out a website in tables? Please explain me. I discovered how to make tables and I thought they look cool on my website. I use them on my first page to write news about my website, for example each "new" has its own table. Is something wrong with that? I didn't understand what you guys mean. They mean that you shouldn't use tables to position information on your website (unless it is information that is supposed to be in a table) and definitely not for the structure of your website. From your description, I'm guessing your news section doesn't need to be in a table. You can surround the information with <div></div> tags and use CSS to define how it looks on the page. Do you have some CSS knowledge?
September 10, 201016 yr Author thanks B2F. I do have some knowledge with CSS but not a lot. I am trying to replicate my table design with CSS now. How can I make an outlining border around the div? Also how could I make there be dividing horizontal line separating a div into two sections?
September 10, 201016 yr thanks B2F. I do have some knowledge with CSS but not a lot. I am trying to replicate my table design with CSS now. How can I make an outlining border around the div? Also how could I make there be dividing horizontal line separating a div into two sections? you can use #div { border: 1px solid #000000: } for the border between divs you could use <hr> and then style the hr in the css or use an image (not sure if <hr> is still correct)
September 11, 201016 yr @pat24, i still use <hr />, it's also remaining in the new html5 spec, so fairly future proof for now. According to the new html5 spec though, <hr /> defines a change in content (as opposed to being a merely aesthetic line).
Create an account or sign in to comment