473,782 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I get the same space between html tables in Firefox and IE?

3 New Member
When I create an html web page with tables, the space between the tables is correct when I look at the web page in Firefox, but incorrect when I look at the web page in IE.

I have put an example of this in: http://www.doug-long.com/atest.htm . The third paragraph is in its correct position in Firefox but is pushed off to the side in IE.

How can I code so the tables are the same distance apart in both Firefox and IE? (I have Firefox 3.0.4 and IE 6, but people who will read my web page could have different versions).
Mar 23 '10 #1
4 3253
drhowarddrfine
7,435 Recognized Expert Expert
Not sure what you mean. They both look pushed off to the side. But you will never get IE to attempt to perform like other far more modern browsers without a doctype. Add this to your first line:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Normally I would never recommend the transitional doctype but you are using old, deprecated markup from the 1990s and it will never validate with the proper 'strict' one.

After that, validate your html and css for those lists of errors.
Mar 23 '10 #2
lesterhawkins
3 New Member
Thank you for the reply. I should have clarified that by "the space between the tables" I meant the approximately quarter inch of space that each table was supposed to be below the table above it I also should have clarified that I aligned the 3rd table on the right side on purpose, but in IE it goes right off the page, without putting the 3rd table a quarter of an inch below the 2nd table.

I created a new web page - http://www.doug-long.com/btest.htm - and put in the code you suggested in the first line. I tried the code like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

and also like this, without the ! comment code:

<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

but it still came out the same as before, with IE giving no space between the 2nd and 3rd tables and pushing the 3rd table off the page to the right.

You're right about my code being from the 1990s. Is there some more recent HTML code or CSS code I should be using to get the proper spacing between my tables?

Thanks again.
Mar 24 '10 #3
drhowarddrfine
7,435 Recognized Expert Expert
You're not allowed to be creative with doctypes and it must be entered exactly as I show it. Without one, browsers go into "quirks mode" and that's a bad thing.
You're right about my code being from the 1990s. Is there some more recent HTML code or CSS code I should be using to get the proper spacing between my tables?
You shouldn't be using tables to layout web pages at all unless there's much more to this than you show. Here's something I wrote that does exactly the same thing as yours but with much less markup:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2.    "http://www.w3.org/TR/html4/strict.dtd"> 
  3. <html> 
  4. <head> 
  5. <title>A Test Table Site</title> 
  6. <meta http-equiv="content-type" content="text/html;charset=utf-8"> 
  7. <style type="text/css"> 
  8. body { background-image: url(http://www.doug-long.com/backblue.jpg) }
  9. h1 { text-align:center }
  10. h2 { text-align:center }
  11.  
  12. p { 
  13.     width:80%;
  14.     padding:1em;
  15.     border:8px #ccc outset;
  16.     background-color: #FEFFDC;
  17. }
  18.  
  19. #one { margin:0 auto; color:blue }
  20. #two { color:green }
  21. #three { margin-left:auto; color:red}
  22. </style> 
  23.  
  24. </head> 
  25. <body> 
  26.  
  27. <h1>Chapter 1</h1> 
  28. <h2>Introduction to the Chapter</h2> 
  29.  
  30. <p id="one">"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p> 
  31.  
  32. <p id="two">At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae.</p> 
  33.  
  34. <p id="three">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.</p> 
  35. </body> 
  36. </html> 
  37.  
Mar 24 '10 #4
lesterhawkins
3 New Member
Your code solution worked - thanks much. I can see where I need to learn CSS, which is new to me. I'll see if I can find a good book on it, to read before I continue coding web pages.
Mar 24 '10 #5

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

Similar topics

12
9411
by: skeeterbug | last post by:
http://www.geocities.com/operationsengineer1/test2.htm the extra space between the logoHeader and the menu bar occurs when i add the <ul>. if i comment out the ul and and all the li, the 1em space disappears in firefox. http://www.geocities.com/operationsengineer1/test3.htm it never shows in ie6. if i increase the margin of hmenu to 1 em, there is no effect on the top and bottom, but the right and left are
16
9264
by: Uncle Pirate | last post by:
This has me stumped. I am trying to use as little space as possible at the top of my document but Firefox/Mozilla insists on placing vertical space before any element. IE displays it correctly (as I want). At one point, I set some negative top margins which moved the graphics above the page in IE. Here's the link: http://abateofnm.org/ I've tried reformatting the HTML to assure there is no white space and I've tried setting top...
22
2474
by: Trammel | last post by:
Hi, I am here to request support from anyone that has idea's on cross-browser HTML (Mainly Firefox and IE). My personal website http://trammel.no-ip.info works fine on Firefox but IE decides to crush the left table (ingnoring that there is no breakable spaces). I tried using nowrap already and IE still forces a wrap of the text in the menu... thats why I tried using non-breaking spaces instead of normal ones... so there was nowhere to...
8
6874
by: lkrubner | last post by:
Am I wrong, or do paragraphs have extra space on top in FireFox, when compared to Microsoft IE. The top of this page is an example: http://www.publicdomainsoftware.org/index.php?pageId=299 The text in the box at top looks like it has an extra 10 or 20 pixels of padding at the top, when FireFox is compared to IE. Why is that?
5
718
by: Michael Shell | last post by:
Greetings, Consider the XHTML document attached at the end of this post. When viewed under Firefox 1.0.5 on Linux, highlighting and pasting (into a text editor) the <pre> tag listing will preserve formatting (white space and line feeds). However, this is not true when doing the same with the <code> tag listing (it will all be pasted on one line with multiple successive spaces treated as a single space) despite the fact that...
59
3669
by: phil-news-nospam | last post by:
In followups by Brian O'Connor (ironcorona) to other posts, he repeats the idea that using tables in CSS is not something that should be done because IE doesn't support it. Of course I'm not happy about the fact that IE doesn't support CSS tables. But what can one do about that? And tables of one type or the other are needed in some cases (regardless of whether some people feel it is appropriate or not). So the issue I and considering...
8
15012
by: maroger | last post by:
I'm sure this is a common issue, but I haven't come across anything that works for me thusfar. I am trying to fix my header, which works fine in firefox but has extra space in IE. Here are example html and css files that illustrate my problem: http://torch.cs.dal.ca/~mroger/css/ietest.html http://torch.cs.dal.ca/~mroger/css/styles.css I would like to get both browsers to display the page as firefox does. That is, with no space...
3
12533
by: amandadev | last post by:
Hi there, Please take a look at: bluecelery.amandadevries.com/index.html as well as the CSS and tell me why there is a white space in the table in Firefox (that looks like a white horizontal line running through the entire layout) which isn't present in IE (which, by the way, is the way I want it to be).
13
1994
by: Paul Lautman | last post by:
I was using the following code: element.value = element.value.replace(/ /g,''); to remove all the spaces in a string. However in IE6 it complained with and "Expected ')'" error. How can I tell IE6 to replace just spaces (i.e. not using \s)?
5
2576
by: Richard Maher | last post by:
Hi, Can someone please show me how to tell Firefox to preseve white-space when returning the selectList.option.value attribute? I have change the style so that the white-space is preserved on the screen, but for some bizarre reason when I try to substring out a series of bytes (aka a fixed-length string or field) from a given option it squashes everything up and corrupts the result.
0
9641
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
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...
0
8968
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
7494
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
5378
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...
1
4044
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
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.