Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-28-2009, 12:44 AM   PM User | #1
wormy123
New to the CF scene

 
Join Date: Dec 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
wormy123 is an unknown quantity at this point
Unhappy Firefox Table TD ignores padding-bottom:0;

Hello,

I have a table as follows:

<table>
<tr>
<td>
*PROBLEMATIC CELL*
</td>
<td rowspan="2">
</td>
<td rowspan="3">
</td>
</tr>

<tr>
<td>
</td>
</tr>

<tr>
<td colspan="2">
</td>
</tr>
</table>

The first cell of the first row, has a padding at the bottom. Well it's not really padding but it looks like padding and using firebug I can not find what the space there actually is.

I think what is happening is that, firefox automatically adjusts the bottom padding of the first td in the first tr with the padding top of the first and only td of the second tr.

p.s. works perfectly fine in Chrome.

please help me
wormy123 is offline   Reply With Quote
Old 12-28-2009, 01:32 AM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,598
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Try td {vertical-align: top;}. This is sometimes the cause for confusion.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 12-28-2009, 01:37 AM   PM User | #3
wormy123
New to the CF scene

 
Join Date: Dec 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
wormy123 is an unknown quantity at this point
Quote:
Originally Posted by VIPStephan View Post
Try td {vertical-align: top;}. This is sometimes the cause for confusion.
I have the vertical align set to top on the first td of first tr.

On the first td of the second tr the vertical align is set to bottom.

But things still don't work
wormy123 is offline   Reply With Quote
Old 12-28-2009, 03:15 AM   PM User | #4
drhowarddrfine
Senior Coder

 
Join Date: Oct 2005
Posts: 1,340
Thanks: 0
Thanked 61 Times in 60 Posts
drhowarddrfine can only hope to improve
Quote:
Originally Posted by wormy123 View Post
I think what is happening is that, firefox automatically adjusts the bottom padding of the first td in the first tr with the padding top of the first and only td of the second tr.
Well, no, FF does not do that, but I don't see the problem anyway.
drhowarddrfine is offline   Reply With Quote
Old 12-28-2009, 03:18 AM   PM User | #5
drhowarddrfine
Senior Coder

 
Join Date: Oct 2005
Posts: 1,340
Thanks: 0
Thanked 61 Times in 60 Posts
drhowarddrfine can only hope to improve
Quote:
Originally Posted by wormy123 View Post
I have the vertical align set to top on the first td of first tr.

On the first td of the second tr the vertical align is set to bottom.

But things still don't work
Now I'm confused.
drhowarddrfine is offline   Reply With Quote
Old 12-28-2009, 06:26 AM   PM User | #6
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
p.s. works perfectly fine in Chrome.

please help me
Please post your complete code including DOCTYPE.
If you are using tables for making your layout, read http://www.hotdesign.com/seybold/ first.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 12-28-2009, 11:07 AM   PM User | #7
wormy123
New to the CF scene

 
Join Date: Dec 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
wormy123 is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
Please post your complete code including DOCTYPE.
If you are using tables for making your layout, read http://www.hotdesign.com/seybold/ first.
Here is the website:

http://mmamail.com/index.php
wormy123 is offline   Reply With Quote
Old 12-28-2009, 11:15 AM   PM User | #8
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Try adding
Code:
*{margin:0;padding:0;}
into your CSS, to reset all browser specific default values of margins and paddings from all elements. If that doesn't solve, please provide the location where the issue resides.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

Last edited by abduraooft; 12-28-2009 at 11:19 AM..
abduraooft is offline   Reply With Quote
Old 12-28-2009, 11:20 AM   PM User | #9
wormy123
New to the CF scene

 
Join Date: Dec 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
wormy123 is an unknown quantity at this point
I have the following in my CSS:

table, tbody, thead, tfoot, tr, th, td {
border:0;
margin:0;
padding:0;
}

If you try using firebug to see what that space actually is you will see that it is not any padding or margin of any sort.

however I tried the suggested solution but it still didn't work.

The problem is that this is not actually a padding problem, it's the way Firefox tries to fight two conflicting paddings to achieve the best results. Unfortunately it decides to respect the 20px top padding of the TD underneath it more than the padding-bottom of the first TD.

Can this be resolved anyhow using the !important property?

Last edited by wormy123; 12-28-2009 at 11:24 AM..
wormy123 is offline   Reply With Quote
Old 12-28-2009, 11:32 AM   PM User | #10
wormy123
New to the CF scene

 
Join Date: Dec 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
wormy123 is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
Please post your complete code including DOCTYPE.
If you are using tables for making your layout, read http://www.hotdesign.com/seybold/ first.

Unfortunately I am using tables for my layouts. The problem I encounter when not using tables is that browsers(IE) don't support stuff like display:table-cell properly so I am left with two options

1. use tables and fix webpages quickly and easily with less code
2. use divs and css an put in a hundred different hacks for every browser, specify div widths, float everything and really bloat up my css.

For now I will continue to use tables until browsers such as IE start supporting more CSS properties.
wormy123 is offline   Reply With Quote
Old 12-28-2009, 05:09 PM   PM User | #11
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Quote:
Originally Posted by wormy123 View Post
Unfortunately I am using tables for my layouts. The problem I encounter when not using tables is that browsers(IE) don't support stuff like display:table-cell properly so I am left with two options

1. use tables and fix webpages quickly and easily with less code
2. use divs and css an put in a hundred different hacks for every browser, specify div widths, float everything and really bloat up my css.

For now I will continue to use tables until browsers such as IE start supporting more CSS properties.
That is not a valid argument for using tables. Your using CSS3 stuff for your rounded corners in spite of the fact that it is not supported by IE and adds bloat to your CSS.
In fact, nothing on your page would require any sort of hack at all... maybe something for IE to get your min-width settings right.


p.s. There is a link in my signature line about tables that I like better than the one it was originally suggested you look at.

...
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:34 PM.


Advertisement
Log in to turn off these ads.