Welcome to WebmasterWorld Guest from 3.81.29.226

Forum Moderators: open

Message Too Old, No Replies

Firefox can't add?

o.o

     
7:47 pm on May 14, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 29, 2005
posts:169
votes: 0


Ok, so here I playing around with mixing CSS and tables. So I make two stacked tables. The first table has 4 columns (1 row). The second table has 3 columns (1 row). The two outer columns are both set at 5% width. On the first table, the two inner columns are set at 45%. On the second table, the single inner column is set at 90%. However, they don't line up in firefox. The second table is a few pixels wider. This is with margin: 0 auto; set on the body. But if I add another cell to the second table and change the width of the two inner cells, it lines up...

Now, correct me if I'm wrong, but 45 + 45 = 90, right? :p

Anyhow, I tried to tweak it just a bit. It seems that it lines up at 89.9%. That is until I resize the browser...

Guess I'll have to resort to nesting the tables /sigh

Note for CSS Evangelists: Don't bother explaining your visions :) I've been there, done that. When the standards become standard and visitors can all enjoy the benefits, then I'll switch. ;p

9:53 pm on May 14, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 29, 2005
posts:169
votes: 0


Ok, apparently it can add, but only if you give it a calculator...lol.

Apparently, it cannot 'accurately' calculate the percentages unless you make sure the style sheet gives it no padding and has collapsed the borders. Figures, heh.

2:44 am on May 15, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 9, 2003
posts:1908
votes: 0


Are you sure this ins't a box model issue? Remember that Gecko browsers (correctly) determine total width as width + padding + border + margin.
4:41 am on May 15, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 29, 2005
posts:169
votes: 0


It is but isn't at the same time. The tables I created were set with no borders, padding or margin (in the CSS). However, once I added the border-collapse attribute, that fixed it.

Now I'm just down to the problem of how to make my semi-fluid layout work with pixel-based attributes. For example, a body that has 10% margin (5% per side) and a table that is supposed to fill the rest of the window, but yet add a 1 pixel border on each side. I guess I can assign the borders to my <td>s and not assign them a width.../shrug. Almost as evil as divs :p