How to get table to work?

liunx

Guest
I've added the <style></style> stuff on my page, but I just can't get tables to work with this code. I added the BODY code inside the STYLE, but the tables didn't appear nor cut the text on the page. So I tried to put the whole page inside the normal <body></body> stuff with the STYLE code still in. The page appeared as usual, which means WITHOUT tables. Hope you can help me.:(<!--content-->Show us the code for the page.<!--content-->Style tags go in the HEAD of the document. The rest should go inside the BODY tags.<!--content-->Here's the code:<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><br />
<br />
<html><br />
<head><br />
<title>eXtrem multimedia</title><br />
<style><br />
BODY {SCROLLBAR-FACE-COLOR: #66CCFF; <br />
SCROLLBAR-HIGHLIGHT-COLOR: ; <br />
SCROLLBAR-SHADOW-COLOR: ; <br />
SCROLLBAR-3DLIGHT-COLOR: #000000; <br />
SCROLLBAR-ARROW-COLOR: #000000; <br />
SCROLLBAR-TRACK-COLOR: ;<br />
SCROLLBAR-DARKSHADOW-COLOR: #000000;<br />
MARGIN: 20px; FONT-FAMILY: tahoma,helvetica,sans-serif;<br />
background-image : url(bg.gif);<br />
background-attachment : fixed; }<br />
</style><br />
</head><br />
<body><br />
<img src=http://www.webdeveloper.com/forum/archive/index.php/"logo.gif"><br><br><br />
<table><br />
<tr align="left" valign="absolute" width="250"> <br />
<applet code="ZChat.class" codebase="http://zchat.no" width="250" height="200"><br />
<param name="language" value="norwegian"><br />
<param name="private" value="false"><br />
<param name="background" value="#FFFFFF"><br />
<param name="foreground" value="#000000"><br />
<param name="fieldtext" value="#000000"><br />
<param name="fieldback" value="#FFFFFF"><br />
<param name="buttontext" value="#000000"><br />
<param name="buttonback" value="#E1E1E1"><br />
<param name="listtext" value="#000000"><br />
<param name="listback" value="#FFFFFF"><br />
<param name="channel1" value="#Generell Chat"><br />
<param name="channel2" value="#Alternativ Chat"><br />
<param name="channel2" value="#Eksklusiv Chat"><br />
</applet><br><br />
<br />
</tr><br />
<tr align="left" valign="absolute" width="100%"><br />
</tr><br />
</table><br />
</body><br />
</html><!--content-->Ah, that's simple. You've missed out the table cell tag <td>. After each table row tag <tr> the content must go inside a cell tag.<!--content-->Actually, it's not that simple. I've tried to put the <td> stuff in, but it has no effect neither with or without <tr>s in it.<!--content-->Whether they work or not, cell tags are required in HTML.<!--content-->Yes, I know that, but the code just won't work! Actually, the <tr> tags were supposed to be <td> tags, I wrote them wrong. But everything works great as soon as I remove the <style> code, which means that the problem must be in there!<!--content-->Some of the styles aren't given any values! You can not leave them blank.<br />
<br />
So this: SCROLLBAR-HIGHLIGHT-COLOR: ;should be this: SCROLLBAR-HIGHLIGHT-COLOR:#FFF;Or whatever colour you prefer. [Tip: you can shorten the values if they are the same. So #FF6699 can be shortened to #F69.]<!--content-->I just wanted to leave them there for reference if I'd want to change them later. But even so, when I remove them the tables STILL won't work nor when I fill out values for them. WHAT am I doing wrong?<br />
<br />
I'm getting kinda desperate here!<!--content-->I just tested your code and it works for me. I added <td>s but removed the applet stuff. I see a broken image, then two rows of text.<br />
<br />
Have you tried adding border="1" to the table?<br />
<br />
Are you seeing any text in any cells at all? Are you sure the table really isn't there?<!--content-->Ok, listen. I'vre rewritten the whole code and it looks great (the page, I mean)! It works perfectly, but I still don't get why it didn't work earlier...<!--content-->Here's the new code. By the way, there were no problems at all with the <style> tags! It was the tables that were wrong! :rolleyes:<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><br />
<br />
<html><br />
<head><br />
<title>eXtrem multimedia</title><br />
<style><br />
BODY {SCROLLBAR-FACE-COLOR: #66CCFF; <br />
SCROLLBAR-HIGHLIGHT-COLOR: ; <br />
SCROLLBAR-SHADOW-COLOR: ; <br />
SCROLLBAR-3DLIGHT-COLOR: #000000; <br />
SCROLLBAR-ARROW-COLOR: #000000; <br />
SCROLLBAR-TRACK-COLOR: ;<br />
SCROLLBAR-DARKSHADOW-COLOR: #000000;<br />
MARGIN: 20px; FONT-FAMILY: tahoma,helvetica,sans-serif;<br />
background-image : url(bg.gif);<br />
background-attachment : fixed; }<br />
</style><br />
</head><br />
<body><br />
<img src=http://www.webdeveloper.com/forum/archive/index.php/"logo.gif"><br><br><br />
<table><br />
<td align="left" valign="absolute" width="266"><br />
<applet code="ZChat.class" codebase="http://zchat.no" width="266" height="200"><br />
<param name="language" value="norwegian"><br />
<param name="private" value="false"><br />
<param name="background" value="#FFFFFF"><br />
<param name="foreground" value="#000000"><br />
<param name="fieldtext" value="#000000"><br />
<param name="fieldback" value="#FFFFFF"><br />
<param name="buttontext" value="#000000"><br />
<param name="buttonback" value="#E1E1E1"><br />
<param name="listtext" value="#000000"><br />
<param name="listback" value="#FFFFFF"><br />
<param name="channel1" value="#Generell Chat"><br />
<param name="channel2" value="#Alternativ Chat"><br />
<param name="channel3" value="#Eksklusiv Chat"><br />
</applet><br />
</td><br />
<td valign="absolute" width="70%"><br />
Velkommen til eXtrem Multimedia! Her kan du lese om musikk, du kan chatte, <br />
du kan finne info om software, hardware<br />
</td><br />
</table><br />
</body><br />
</body><br />
</html><!--content-->Glad to hear it now works! But you still need the <tr> tags. Again, they are required by HTML.<!--content-->it doesn't seem that way; 1. the page works fine without those damn <tr> tags, and 2. I won't take the chance of screwing up the page again :D <br />
Thanx for all your help by the way, I'd never have found the error if I didn't get to know that the error WAS in the <table> code. Thank you very much!<!--content-->Well, there's one more thing I want to ask you for;<br />
<br />
Do you know any good menu scripts?<br />
<br />
I'm adding a fancy menu to my page, but I don't want to write the code myself.<!--content-->It's not a matter of leaving out tags that don't seem to work. You have to write code that follows the HTML spec. Otherwise other browsers can screw up your page.<br />
<br />
For instance, I can leave out the end table tag </table> and my page still works. But try it in Netscape 4 and the table disappears!<br />
<br />
<tr> denotes a new row. If you only use one row, then sure, it will work. But what happens when you want a table with two rows in it?<br />
<br />
If the code breaks when adding the <tr> tags, then there is a problem inside the table somewhere.<br />
<br />
Lastly, what does valign="absolute" do? I thought valign ('vertical-align') was either "top" or "bottom" or "center".<br />
<br />
Sorry to be picky, but any employer would not employ someone if they looked at their code and saw missing tags. Plus it will cause you problems later on when your code gets more complex.<!--content-->
 
Back
Top