473,670 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help! cell padding inconsistency- Firefox vs. IE7

2 New Member
Hello all,
am very frustrated because I can't get a simple table to display the same way in both browsers. It displays the way I want it to in Firefox but not in IE7 (Windows XP).

1) not sure if my doctype is correct- this is just a plain vanilla html page, so I used
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">

2) I have tried to put cell padding=0, margin=0 on the table and the table cells in both the style sheet and the html document. No combination has worked so that IE7 will display the table row without the slight padding at the bottom of the row.

I have added a border so that you can clearly see that the bottom of the rounded red corners do not touch the bottom of the row.

I've even set the width and height of the table cells to those of the graphic but no luck. (I've checked the graphic, there is no white border around it).

3) I can't get the center td's contents (a 1px by 1px graphic that I've stretched to 300 px) to align to the top in IE7.

Any help is appreciated, thank you!

Here's the page ...

Here is my html page's code:

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2.  
  3. <html lang="en">
  4. <head>
  5. <title>Foreclosure Prevention USA home page
  6. </title>
  7.  
  8. <style>
  9. h1 {color: #ff0000; font-size: 26px; font-family: arial;}
  10.  
  11.  
  12. table {
  13. border-collapse: collapse; 
  14. padding: 0px;
  15. margin: 0px;
  16. }
  17.  
  18. tr {
  19. padding: 0px;
  20. margin: 0px;
  21. }
  22.  
  23. td {
  24.   padding: 0px;
  25.   margin: 0px;
  26.   }
  27.  
  28. td.cellTopAlign {vertical-align: top;}
  29. td.cellBottomAlign {vertical-align: bottom;}
  30.  
  31. </style>
  32.  
  33. </head>
  34.  
  35.  
  36. <body>
  37. <h1>Foreclosure Prevention USA home page
  38. </h1>
  39.  
  40. <table border="1" cellpadding="0" cellspacing="0">
  41. <tr height="65px">
  42. <td class="cellTopAlign"><img src="top_left_rounded_corner.jpg" width="65px" height="65px"/>
  43. </td>
  44. <td class="cellTopAlign"><img src="pixel.jpg" width="300px" height="1px"/>
  45. </td>
  46. <td class="cellTopAlign"><img src="top_right_rounded_corner.jpg"width="65px" height="65px"/>
  47. </td>
  48. </tr>
  49.  
  50.  
  51. </table>
  52. </body>
  53. </html>
  54.  
Aug 3 '07 #1
12 16086
drhowarddrfine
7,435 Recognized Expert Expert
Your doctype is fine. All new pages should always use the strict doctype.
But you should never use tables for layout.

Validate for your list of 31 html errors. The 'alt' errors can be ignored for now.

Another problem you'll have is with that geocities page. The garbage they put at the top will throw IE into quirks mode. That's not the problem with your table right now, though.
Aug 3 '07 #2
Koelner
2 New Member
Hello drhowarddrfine!

You are absolutely right- I scrolled through the 31 errors and almost all of them are from garbage code that geocities inserted.

The only reason I ftp'd the page out to geocities is because I do not yet have a web hosting service. I just needed a way for you guys to be able to look at this page.

If you copy and paste my code into an html document and view it locally on your computer, I'd be curious how it looks for you. I found that when looking at it on Geocities in Firefox, the table displays the way I intend (graphics are all lined up, and no white space at the bottom of the rounded red corners). If I open the html page locally on my computer, it doesn't even display properly in Firefox, let alone IE7.

You recommend that I don't use tables for layout, but I'm just not sure what's the most efficient way to set up a containing "box" like this which will hold text. Should I make the entire box as a graphic and use layers to position text inside of it?

Thanks!


Your doctype is fine. All new pages should always use the strict doctype.
But you should never use tables for layout.

Validate for your list of 31 html errors. The 'alt' errors can be ignored for now.

Another problem you'll have is with that geocities page. The garbage they put at the top will throw IE into quirks mode. That's not the problem with your table right now, though.
Aug 6 '07 #3
drhowarddrfine
7,435 Recognized Expert Expert
You recommend that I don't use tables for layout, but I'm just not sure what's the most efficient way to set up a containing "box" like this which will hold text.
Heading to the ball game. Threw this together. I'll be back.
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2.  
  3. <html lang="en">
  4. <head>
  5. <title>Foreclosure Prevention USA home page
  6. </title>
  7.  
  8. <style type="text/css">
  9. *{margin:0;padding:0} 
  10. h1 {color: #ff0000; font-size: 26px; font-family: arial;}
  11.  
  12. #left{
  13.     width:65px;
  14.      height:65px;
  15.  
  16. }
  17. #middle{
  18.     width:65px; height:1px; vertical-align:top;
  19. }
  20. #right{
  21.     width:65px; height:65px
  22. }
  23. </style>
  24.  
  25. </head>
  26.  
  27.  
  28. <body>
  29. <h1>Foreclosure Prevention USA home page
  30. </h1>
  31.  
  32. <img id="left" src="top_left_rounded_corner.jpg">
  33. <img id="middle" src="pixel.jpg" >
  34. <img id="right" src="top_right_rounded_corner.jpg" >
  35.  
  36. </body>
  37. </html>
  38.  
Aug 6 '07 #4
Sunny1957
6 New Member
Hello Koelner,

I think the solution for your problem you can find on my page
[DELETED]

Sunny1957
Aug 27 '08 #5
RedSon
5,000 Recognized Expert Expert
Hi Sunny,

This is an English only site. Please be sure to provide links to English language sites.

Thanks!
Aug 27 '08 #6
Sunny1957
6 New Member
Hello Redson,
I'm very sorry for my link to my German page. I now have corrected it. The only German words are directory and file names. I hope this is for now ok.
picture in a table without slight padding at the bottom of the row
best regards
Uwe
Aug 27 '08 #7
RedSon
5,000 Recognized Expert Expert
Hello Redson,
I'm very sorry for my link to my German page. I now have corrected it. The only German words are directory and file names. I hope this is for now ok.
picture in a table without slight padding at the bottom of the row
best regards
Uwe
Thanks for the update!

Nice description!
Aug 27 '08 #8
David Laakso
397 Recognized Expert Contributor
You did not ask how you might do the entire layout without using a table. This strikes me as strange, since you have no tabular data whatsoever. Nevertheless, it is your call. But, If your call might include the possibility of a ditching the 1990s table layout you are striving for in favor of producing a contemporary tableless CSS layout, let me know. I will try to help to help...
Aug 28 '08 #9
Sunny1957
6 New Member
You did not ask how
This is a misunderstood, because I wouldn't ask something. My post should be the solution for question 2)
No combination has worked so that IE7 will display the table row without the slight padding at the bottom of the row.
of the thread opener Koelner. And also it should be the answer of question 3).
I can't get the center td's contents (a 1px by 1px graphic that I've stretched to 300 px) to align to the top in IE7.
In both cases, all to do is: remove the eol before </TD>
you have no tabular data whatsoever.
That's not correct. Ok it's a very small table, only 1 cell, and the data is no text, only a picture.
If you open my page and the right "table" ( produced by sample code ) in example 1 is identical to the left "table" ( hard coded picture ) in example 2 then you do not use IE7.
Otherwise you use perhaps Firefox 3.0.1. Other browsers/versions not testet.
Aug 28 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
17875
by: Rowland | last post by:
Hi, I've got a field that stores numeric values, representing a tracking number. I've also got a stored procedure that will extract this field and return it to a client. However, I would like to return it slightly differently to the way in which it is stored. Basically, I want to return it as TRK000nnn - Where TRK is the string "TRK", 000 is zero-padding up to 4 zeros, and nnn is the number itself - results would look something like...
3
10710
by: Steve Sabljak | last post by:
I seem to having a little trouble getting a table to display correctly in both msie and firefox. I want to set the table and column widths in pixels, and have some cell padding too. The table displays correctly in standards compiance mode in firefox, but not msie, where the padding is added on to the column widths. the table size is always correct, but the column widths are not what I expect them to be. If I change the column widths to...
0
2674
by: Dabbler | last post by:
I need more space between my columns but increasing cellpadding increases vertical spacing and the gridview flows below "the fold". Is there some way to increase only horizontal padding? I tried setting padding-left/padding-right in the row style but that did nothing. Thanks.
10
12901
by: Alan Silver | last post by:
Hello, In my (seemingly) endless quest to understand CSS, I have yet another problem. Please look at http://www.kidsinaction.org.uk/ph/x.html in Opera, where you will see it how I expected. If you look at it in IE (6 or 7), you find it also looks fine, except for the top margin missing from the links across the top of the page. That's not the main issue here, but any pointers as to why it doesn't show them would be appreciated.
6
7852
by: Andy Mabbett | last post by:
Please can someone remind me of the most elegant fix for the way Firefox fails to vertically align cell content by default? For example, the second event on: http://www.westmidlandbirdclub.com/diary/ Thank you. --
2
4511
by: Jessica M | last post by:
I am having the following problem http://jessica.ourprofile.net/ are being rendered differently on Firefox and IE6 (PC). I have outline the div culprits in red to help with debugging. Basically, the logo div sits about 10 pixels below the top of the page in Firefox pushing content where I want it to be. IE does not push the logo down and hence the problem.
1
1617
by: Paradox | last post by:
For some reason my cell padding isn't working in IE. It works beautifully in Firefox but IE just seems to ignore it. .maintable { width: 800px; padding: 8px 8px 0px 8px; height: inherit;
2
4736
by: shapper | last post by:
Hello, How can I define the cell padding and cell spacing of a table using a CSS class? Thanks, Miguel
2
3991
by: laszlokenez | last post by:
Tested in IE7 and FF2. I have 2 frames, 2 similar tables in them, similar CSS. (I have 1px cellpadding, and 1px border aroud the cells. From one frame I read the offsetHeight of a cell (getElementById), and set the height of the corresponding cell in the other frame. Here: window.parent.frames.document.getElementById('r2').style.height=(document.getElementById('r2'i).offsetHeight) + 'px'; Everything works perfectly, cell gets...
0
8907
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8593
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8663
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7423
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6218
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2804
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.