Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7169933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:06:36+00:00 2026-05-28T15:06:36+00:00

How can I have fixed height for table cells in Firefox? The following works

  • 0

How can I have fixed height for table cells in Firefox? The following works in IE and Chrome, but Firefox is not using the specified height:

<!DOCTYPE html>
<html>
    <head>
        <title>Table Cell Height Test</title>
        <style type="text/css">
        * {
            padding: 0;
            margin: 0;
        }

        .overlay {
            border-collapse: collapse;
            table-layout: fixed;
            position: fixed;
            top: 0px;
            left: 0px;        
        }

        .overlay th {
            padding: 4px;
            border: 1px solid black;
            background-color: white;
        }

        .test {
            border-collapse: collapse;
            table-layout: fixed;
        }

        .test th {
            padding: 4px;
            border: 1px solid black;
            background-color: yellow;
        }
        </style>
    </head>
    <body>
        <table class="overlay">
            <thead>
                <tr>
                    <th style="height: 42px;">Staff</th>
                </tr>
            </thead>
        </table>
        <table class="test">
            <thead>
                <tr>
                    <th style="height: 42px;">Staff</th>
                    <th style="height: 42px;">Monday<br>
                     27th</th>
                </tr>
            </thead>
        </table>
    </body>
</html>

The aim is to have overlay the same height as the test table.

One solution I have found is to wrap the cell contents in a div and set the height on the div.

Another solution I have found is using jQuery,

$('table.overlay tr').height($('table.test tr').outerHeight());

Are there any other solutions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:06:37+00:00Added an answer on May 28, 2026 at 3:06 pm

    The height of a cell depends on the height requirements of its contents, and any height value set will be taken as imposing a minimum height. When the content is text, the height requirements depend on the number of lines of text and on the line height, which may vary by browser. So if you really want consistent rendering within some fixed (in pixels) area, you would need to set font size and line height in pixels (which implies problems of its own of course).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table where the cells have a fixed height. Within the table
This is probably a dum error that can be fixed in seconds but have
I have the following html (i'm also using Jquery and JqueryUI) <div style=display:none; position:fixed;
I have a table in a HTML form. It has a fixed height for
I can't make td Date to have fixed height. If there is less in
Let's say I have a table cell with fixed width and height.... and I
I have an element that can have multiple types (not my design). The element
I have a property column which can have a subset of the following values
I have a cell with fixed height and I want the font size of
I have a table coded as below; <table style=table-layout:fixed> <tr> <td class=htTd width=100 style=word-wrap:break-word>someDynamicLongtextsomeLongtextsomeLongtextsomeLongtextsomeLongtextsomeLongtextsomeLongtextsomeLongtext</td>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.