Solved

IE and FF display tables differently

Posted on 2007-03-31
4
247 Views
Last Modified: 2013-12-08
Please go to http://www.richel.org/grk/uraniumplenty/  and notice the difference in the display of the 2 tables in either IE7 or FF1.5.
How can I get rid of these differences?

Thanks
0
Comment
Question by:TheoRichel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
Steggs earned 250 total points
ID: 18828795
Hello,

your html is a bit out of date. This is how to style a table:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Untitled Document</title>
<style type="text/css">
table#table1 {
border-collapse:collapse;
background-color:#ccffff;
}
table#table1 tr td {
text-align:center;
border:1px solid #000;
}
</style>
</head>
<body>
<table id="table1">
<tr>
<td style="width:94px;">Cell 1</td>
<td style="width:93px;">Cell 2</td>
<td style="width:94px;">Cell 3</td>
<td style="width:93px;">Cell 4</td>
</tr>
<tr>
<td>Cell 5</td>
<td>Cell 6</td>
<td>Cell 7</td>
<td>Cell 8</td>
</tr>
</table>
</body>
</html>

0
 
LVL 30

Expert Comment

by:Steggs
ID: 18828802
You can use padding-top and padding-bottom to center the contents of the cells

table#table1 tr td {
text-align:center;
border:1px solid #000;
padding:10px 0;
}
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 18834837
You're mixing 3 methods to do your layout: HTML, CSS (this 3 ways additional: CSS itself, inline as HTML attribute, mixed mode), JavaScript.
Makes approx. 9 variants of rendering.
I guess that it is a useless attempt to give you a fix for your initial problem. Please clean up your code first. Either use CSS + HTML (not CSS inside HTML) or JavaScript using the DOM.
0
 

Author Comment

by:TheoRichel
ID: 18834893
Steggs thanks that was the fix I needed. And ahoffman: you are no doubt very right, I have got a lot to learn still, thanks for the comment.
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question