Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE applying table padding-top on all sides

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
Hi there,

What I am trying to do is add some space above a table (i.e. move the table down by about 10px or so). In an attempt to achieve this I have tried:
Code:
<table border="0" cellspacing="0" cellpadding="0" style="padding: 10px 0 0 0">
and
Code:
<table border="0" cellspacing="0" cellpadding="0" style="padding-top: 10px">
In FF everything behaves as I would expect it to. IE, however adds 10px on each side of the table even though I only asked for the top to have padding applied. I've also tried substituting padding for margin but to no avail.

What am I doing wrong here?

Any advice would be much appreciated!

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Can you provide an example or even better an url to the page? I tried putting a table with [tt]margin-top: 10px;[/tt] and it worked as expected in FF and IE.
 
quite possible it's not your table, but the surrounding elements, that have different default styles applied to them in different browsers...



*cLFlaVA
----------------------------
[tt]mr. pibb + red vines = crazy delicious![/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Sorry to waste your time guys. I've now solved it by wrapping the table in a div and applying a "margin-top: 10px" to the div instead of the table. Not sure what was going on there!

Before posting here, I should have tried reproducing it in isolation. When I did that, as Vragabond did, I couldn't reproduce the problem!

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top