954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Firefox and IE padding issue.

If you take a look at my website in firefox:

and in internet explorer:

you will see the top menu in internet explorer is on the left.

The css code I have used is:

.overbodyline
{ 
background-image:url(/music/images/main.gif);
background-repeat: repeat-y;
{T_TH_COLOR1} solid;
font-size : {T_FONTSIZE2}px;
color : {T_BODY_TEXT};
padding: 0px 0px 0px 40px;
}


and the table code is as follows:

<table width="100%" cellspacing="0" border="0" class="overbodyline">
      <tr><td><table class="stand" width="700px">random gubbins
</table>
</td></tr>
<table>


For some reason the rest of the padding is fine. I've attached the whole file if you need to check out anything else.

Attachments overall_header.txt (13.62KB)
MrScruff
Junior Poster in Training
89 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

In general, CSS spacing issues can be resolved by specifying both the "padding" and "margin" properties of all the affected elements.

Tables have their own properties... try setting "cellpadding".

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

Ah taking of cellpadding - I've tried that and it works but I've found no way of specifying that it only pads the left hand side... any ideas if theres a way to define it?

MrScruff
Junior Poster in Training
89 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 
tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

So theres no way of defining the cellpadding attribute to pad from the left. So back to square one. I wonder why this table is causing trouble when the rest are fine?

MrScruff
Junior Poster in Training
89 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

CSS attributes "cascade", from least-specific to most-specific. You are also mixing inline attributes with CSS class definitions.

In any given TD for your table, you'll get a "combined" or "derived" style based on the inline attributes, the "overbodyline" class, and the "stand" class. Any attributes you've left undefined (such as "margin") will get whatever default the browser uses.

Is the data in your table really tabular? Are you actually presenting a "table" of data? If not, then consider using DIVs, SPANs, and CSS to control appearance and flow. It will be much simpler to troubleshoot these issues if you didn't mix tables and CSS.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

I restructured my tables and got it fixed... yay!

MrScruff
Junior Poster in Training
89 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You