PDA

View Full Version : Firefox Tables Glitch?



Vexir
November 10th, 2006, 03:33 AM
An interesting thing is happening with a layout I am coding. I used tables to code the following, except in Firefox, wierd 2px gaps appear between some of the tables / table rows. I don't know whats causing them at all. They don't show up in IE6 at all! I also found it interesting that my OTHER layouts work just fine, even though I think I used the same method to code them. Also if you notice at the bottom of the Firefox image, the bottom doesn't have a gap... why is this so? It is in fact a separate image, yet it doesn't gap!

Take a look (sorry for the size, i was too much in a hurry to compress :P):

http://www.vexiron.com/FFmessup.jpg
See, no gap at the bottom one... wierd..

And somehow IE got it right:



http://www.vexiron.com/IEcorrect.jpg

Remember its really wierd that it only happens with this layout; the same method I used to slice and code other layouts still works in Firefox, no gaps at all. I'm thinking that it might be something to do with Firefox 2? Not sure.

duncanhall
November 10th, 2006, 09:42 AM
Instead of spending time frustrating over the problem, why not put yourself to better use, head over to http://w3schools.com/css/default.asp and save yourself a lot of trouble in the future.

Vexir
November 10th, 2006, 02:45 PM
Interestingly enough, if I put images in a bunch of div's, the same glitch occurs. It might be a DW problem, I don't know.

Templarian
November 10th, 2006, 04:08 PM
Dreamweaver doesn't have problems its all the same source being read by the browsers. Mabey if you paste what you are doing over.

senocular
November 10th, 2006, 04:38 PM
looks like the result of margin collapse

Vexir
November 10th, 2006, 09:42 PM
Well you asked for the code so:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//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=iso-8859-1" />
<title>Template Page</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body><center>
<table width="766" cellpadding="0" cellspacing="0">
<!-- Header -->
<tr><td valign="top"><img src="images/template_01.jpg" /></td></tr>
<!-- Image for Hierarchy menu -->
<tr><td valign="top"><img src="images/template_02.jpg" /></td></tr>
<!-- This table contains Expanding Content-->
<table width="766" cellpadding="0" cellspacing="0">
<td valign="top">
<!-- This table is two rows in and of itself, and contains the two tables for the LEFT side. -->
<table width="166" cellpadding="0" cellspacing="0">
<tr>
<!-- This cell contains the Navigation table. -->
<td valign="top">
<!-- This table contains the navigation table -->
<table width="166" cellpadding="0" cellspacing="0">
<tr><td valign="top"><img src="images/template_03.jpg" /></td></tr>
<!-- This contains the expanding stuff. -->
<tr><td valign="top" background="images/template_07.jpg" class="expandingtablecell"><pre>
<a href="art.htm"><b>Art</b><br /></a>
<a href="traditional.htm">» Traditional</a>

<a href="digital.htm">» Digital</a>

<a href="misc.htm">» Misc.</a></pre>
</td></tr>
<tr><td valign="top"><img src="images/template_12.jpg" /></td></tr>
</table>
</td>
</tr>
<tr>
<!-- This cell contains the AOTW table -->
<td valign="top">
<!-- This table contains the AOTW -->
<table width="166" cellpadding="0" cellspacing="0" >
<tr><td valign="top"><img src="images/template_14.jpg" /></td></tr>
<!-- This contains the expanding stuff. -->
<tr><td valign="top" background="images/template_07.jpg" class="expandingtablecell">
<p>*Ahem* I believe only I have the right to be called Author of the Week at the moment :P Seeing as I DID author the site.</p>
<p>If you'd like to see how much damn coding this takes, right click and View Source. Not as easy as it looks eh?</p>
</td></tr>
<tr><td valign="top"><img src="images/template_12.jpg" /></td></tr>
</table>
</td>
</tr>
</table>
</td>
<td valign="top">
<!-- This table is the SECOND row, where the main content goes. This only needs three rows and one cell for each row. Simple eh? NOT. -->
<table width="433" cellpadding="0" cellspacing="0">
<tr><td valign="top"><img src="images/template_04.jpg" /></td></tr>
<!-- Expansion! --> <tr><td valign="top" background="images/template_06.jpg" class="contentexpandingtablecell">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi molestie. Vestibulum in arcu ac nisl consequat ultricies. Pellentesque euismod iaculis ipsum. Donec condimentum elementum turpis. Praesent vitae diam. Donec quis nisl. Vestibulum vehicula mollis risus. Nam laoreet, lorem eget cursus sodales, turpis justo ultricies dui, sed rutrum arcu risus quis lorem. Proin tortor neque, venenatis at, luctus vitae, sodales eget, est. Duis libero sem, placerat ac, sollicitudin id, hendrerit ac, nunc. Morbi malesuada nisi quis mi. Sed at lectus vel turpis hendrerit iaculis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Pellentesque a enim vel nisi feugiat dignissim. Nam egestas sodales nisl. Sed elementum urna vitae sem. Proin eget leo. Suspendisse risus ante, eleifend at, elementum vitae, molestie in, mauris.</p>

<p>Quisque nulla est, vulputate vitae, lacinia ut, ultrices et, nunc. In et augue id quam semper mattis. Aliquam scelerisque est non diam. Pellentesque iaculis, dui sed pulvinar iaculis, nunc libero laoreet libero, quis mollis sapien erat sed nulla. Donec eros dui, pellentesque quis, tincidunt ut, condimentum eget, sem. Sed tortor. Pellentesque arcu. Donec fringilla elit id magna. Maecenas adipiscing ornare ligula. Mauris nisi.</p>

<p>Nunc quis nisl. Curabitur ornare mi eu eros. Nunc posuere pharetra erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Nam eleifend, augue nec vestibulum convallis, metus arcu pretium sapien, eget dignissim purus augue eu nunc. Nunc ultricies odio. Quisque eget arcu. Donec vulputate. Praesent consequat tortor sit amet metus. Phasellus eleifend molestie libero.</p>

<p>Nam dictum magna non nibh viverra congue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec congue. Mauris venenatis, nunc euismod ultricies lacinia, augue quam tempus nisl, eu suscipit felis lorem ut massa. Donec convallis, nulla tempor posuere tempus, ipsum metus consequat ligula, id varius tortor nulla a purus. Curabitur metus urna, elementum sed, accumsan vitae, cursus sit amet, felis. Curabitur sollicitudin, mi a posuere laoreet, tortor lectus ultrices orci, in eleifend ante arcu sit amet massa. Suspendisse tellus nulla, suscipit at, fermentum eu, convallis vel, pede. Sed mauris enim, tincidunt ac, fermentum quis, rhoncus id, ante. Sed at nunc. Nullam massa. Pellentesque a augue. Maecenas lorem. Pellentesque nibh. Morbi id libero sed sapien pretium malesuada. Quisque et ipsum a eros accumsan tempor. Nullam sagittis. Sed consectetuer quam ut erat.</p>

<p>Phasellus at neque. Vivamus metus. Cras at purus. Fusce tristique nisi vitae lacus. Nam rhoncus purus sit amet nisi. Vestibulum auctor sagittis mauris. Pellentesque placerat vestibulum orci. Maecenas urna diam, laoreet nec, accumsan vel, imperdiet at, massa. Nunc tempor vestibulum nunc. Sed ante felis, ultricies eget, tempor a, pharetra ut, quam. Mauris consectetuer. Ut fermentum nisl tempus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>

</td></tr>
<tr><td valign="top"><img src="images/template_18.jpg" /></td></tr>
</table>
</td>
<td valign="top">
<!-- This table is the RIGHT side, which contains simply the authors. -->
<table width="167" cellpadding="0" cellspacing="0">
<tr><td valign="top"><img src="images/template_05.jpg" /></td></tr>
<tr><td valign="top" background="images/template_09.jpg" class="rightexpandingtablecell">
<p>Author pages go here, hopefully. Each one should have their own page and a list of stories, photos, and editorials that they have submitted.</p>
<p>If time allows, photos (mugshots) will be taken of each Author and put up on the list, so authors can be located easily.</p>
</td></tr>
<tr><td valign="top"><img src="images/template_16.jpg" /></td></tr>
</table>
</td>
</table>
</table>

</center></body>
</html>


and here is the CSS to go with it:

body {
margin: 0;
padding: 0;
background: #2F4522;
text-align:center;
}

.expandingtablecell {
height:100%;
background-repeat: repeat-y;
vertical-align:top;
text-align:left;
padding-left:35px;
padding-right:20px;
}

.rightexpandingtablecell {
height:100%;
background-repeat: repeat-y;
vertical-align:top;
text-align:left;
padding-right:35px;
padding-left:20px;
}

.contentexpandingtablecell {
height:100%;
background-repeat: repeat-y;
vertical-align:top;
padding-left:15px;
padding-right:15px;
text-align:left;
}

table {
border-collapse:
collapse;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#FFFFFF;
}

pre {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#FFFFFF;
}

a:hover {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#66CC00;
text-decoration:none;
}

a {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#FFFFFF;
text-decoration:none;
}

Vexir
November 10th, 2006, 09:46 PM
DOH, I fixed it. Turns out I had the doctype wrong. I hadn't changed the type from XHTML-Strict from when Nokrev was "helping" me.

Thanks all.

Jeff Wheeler
November 10th, 2006, 10:20 PM
Strict is best when using CSS. :D

nj_jcarter
November 13th, 2006, 09:31 AM
OH NOKREV!!!
[cue music]BWAH BWAH BWAHHHH!!
[Nokrev shrugs at camera]
[insert audience chuckles]

Vexir
November 13th, 2006, 10:56 PM
:h: