• Hey guys, I need some help setting the table height.
    6 replies, posted
So basically, I got the table to take up the entire width of the page, but I want it to take up the entire height of the page and be equal for every row. This is what I have so far. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body style="margin: 0px; padding: 0px;" width="100%"> <table width="100%" border="0" cellspacing="0"> <tr BGCOLOR="#FFFF00"> <td>f </td> <td>f</td> <td>j</td> </tr> <tr BGCOLOR="#8E5100"> <td>d</td> <td>g</td> <td>h</td> </tr> <tr bgcolor="#830000"> <td>j</td> <td >g</td> <td>j</td> </tr> </table> </body> </html>
Why are you using a table the entire width/height of the webpage? And please use [code]Code tags[/code] [noparse][code]...[/code][/noparse] I'd suggest learning css, and create a separate stylesheet. You can use div's to create the same result you want, and it's regarded as better code, because tables should be used for tabular data, not for formatting. You can start [url=http://www.codecademy.com/tracks/web]here[/url]. --- [code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body style="margin: 0px; padding: 0px;" width="100%"> <table width="100%" border="0" cellspacing="0"> <tr BGCOLOR="#FFFF00"> <td>f </td> <td>f</td> <td>j</td> </tr> <tr BGCOLOR="#8E5100"> <td>d</td> <td>g</td> <td>h</td> </tr> <tr bgcolor="#830000"> <td>j</td> <td >g</td> <td>j</td> </tr> </table> </body> </html>[/code]
Why don't you use divs instead? You usage of table makes it seem like you are using it for positioning.
[QUOTE=James xX;40049660]Why don't you use divs instead? You usage of table makes it seem like you are using it for positioning.[/QUOTE] This looks like babby's first Dreamweaver website. I bet quite a few out-of-touch teachers tell their students to make websites that way.
[QUOTE=SteveUK;40069046]This looks like babby's first Dreamweaver website. I bet quite a few out-of-touch teachers tell their students to make websites that way.[/QUOTE] Unfortunately this is the way the teachers are told to teach you, even if they know better
In my college, we have to take 6 hours of another subject to discover it, and one of these courses I picked was "Build a website". It basically involved the teacher telling us to use DreamWeaver, and not even look at the code itself or anything. Needless to say, I gave up and skipped the other 5 hours.
Well, we didn't get told to use dreamweaver. But sadly we got told you can use tables to design the website with. To say the least, the guys I helped out have a website. The others have text. Even worse, not even helping, just saying "go to w3schools".. I feel sad for those guys.
Sorry, you need to Log In to post a reply to this thread.