Click to See Complete Forum and Search --> : Problem with FireFox and <div> and/or <table> tags


Kossu
05-18-2005, 08:33 AM
Hi!

I've got a prob with positioning div's and the table layout in FireFox... Here's the site:

http://www.ratol.fi/~mkoskenk/pennihaat/

It displays just fine on Opera & IE but in Firefox it just prints the contents one after another discarding also the table layout. Any idea what causes this? And furthermore, how to fix this :)

The idea of the javascript code is to print out the table to the page without having to manually add it to every page. Here's an example from menu.js

document.write("<table id=\"menu\" cellspacing=\"0\" cellpadding=\"0\">")
document.write("<tr>")
document.write("<td class=\"otsikko\"> <a class=\"otsikko\" href=\"index.htm\">Pääsivu</a></td></tr>")
document.write("<tr>")
document.write("<td class=\"otsikko\"> <a class=\"otsikko\" href=\"yhdistys.htm\">Yhdistys</a></td></tr>")
document.write("<tr>")
document.write("<td class=\"linkki\"> <a class=\"linkki\" href=\"hallitus.htm\">Hallitus</a></td></tr>")

etc.


Cheers,
Kossu

Sanim
05-18-2005, 09:04 AM
I would do that with a PHP echo, not JavaScript; JavaScript can be disabled on users's browser(s).

Fang
05-18-2005, 09:07 AM
There are errors in your css:body
{
// margin-top: 60px; /* comment not // */
// margin-left: 150px;
margin-right: 150px;
padding-bottom: 20px;
//background-image: url('kuvat/tausta3.jpg');
background-color: #FFFFFF;
font-family: tahoma;
}

h1
{
font-family: tahoma;
align: center; /* not valid */
}
h2
{
font-family: tahoma;
}

Kossu
05-18-2005, 09:13 AM
Okay, that sounds good. I was a bit doubtful about the javascript anyway because of the reason you mentioned and as well for IE being sort of paranoid about scripts and active components.. =ž

So.. If I understood right I can just save the pages as .php and instead of calling javascript I could add:
<?php
$file="menu.html"
echo $file
>

And thanks Fang for pointing those out.. The first bit i commented out isn't actually s'posed to be commented out and in my latest version it isn't. But I'll fir the alignment bit...

Cheers,
Kossu

Kossu
05-18-2005, 09:20 AM
If i wasn't sitting down at the mo, I'd give meself a decent kick in the ass.. There were mistakes as fang pointed out in my css file --> fixed those --> works beautifully. I hope it's not the humble but the stupid who inherit the earth....

Thx mate =)

felgall
05-18-2005, 05:28 PM
The smallest errors are always the hardest to find.