Jump to content

Recommended Posts

I have a style applied to a table with td set to height:25px.  It looks appropriate in Chrome, IE9, Safari but in Firefox it is about 5px too small.  Is there anything that I can apply so that Firefox will keep it consistant with the other browsers?  If I increase it by 5px it makes the other browsers be 5px too tall.

Link to comment
https://forums.phpfreaks.com/topic/267067-table-cell-height-different-in-firefox/
Share on other sites

It's literally just the height command being used.  This is the full CSS and HTML.  No other CSS on the page as I create each element on its own page then when I am happy with how it looks I move it over to the real full page.  I haven't even gotten there yet.

 


#dataTable {
}

#dataTable td {
  height:25px;
}

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">  
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
</style>
</head>

<body>

<table id="dataTable">
  <tr>
    <td>Date</td>
    <td>Name</td>
    <td>Phone Number</td>
  </tr>
  <tr>
    <td>DATA HERE</td>
    <td>DATA HERE</td>
    <td>DATA HERE</td>
  </tr>
</table>


</body>

</html>

 

EDIT: Figured I would include the doctype and all that jazz just in case.

Then your problem stems from the fact that the different browsers have different default values for margins, paddings and so forth. It is highly recommended to reset all of these as the first thing you do, so that you don't encounter issues like this.

To reset all paddings and margins, simply add this to the top of your CSS definition:

* {
    margin: 0;
    padding: 0;
}

It's not quite a complete solution for all browser-differences, but it's a good start. A search of the web will give you lots more information on this subject.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.