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

  • SEARCH
  • Home
  • 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 8067399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:16:53+00:00 2026-06-05T12:16:53+00:00

How do I vertically center a div that is inside a table cell? HTML:

  • 0

How do I vertically center a div that is inside a table cell?

HTML:

<tr class="rowClass">
    <td class="cellClass">
        <div class="divClass">Stuff</div>
    </td>
</tr>

CSS:

.rowClass {
    vertical-align:middle !important;
    height:90px;
}

.cellClass {
    vertical-align:middle !important;
    height:90px;
}

.divClass {
    vertical-align:middle !important;
    height:90px;
}

I know the class definitions are redundant, but I’ve been trying lots of different things. Why isn’t the solution (whatever it is) intuitive. None of the “obvious” solutions that I tried would work.

  • 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-06-05T12:16:55+00:00Added an answer on June 5, 2026 at 12:16 pm

    There is no need to defineheight in .divClass . write like this:

    .cellClass {
        vertical-align:middle;
        height:90px;
        border:1px solid red;
    }
    

    Check this http://jsfiddle.net/ncrKH/

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

Sidebar

Related Questions

To vertically-center align text in a table-cell, I use vertical-align: middle in the td
I'm trying to horizontally and vertically center a modal window inside a div. I
I have a div that I want to center horizontally and vertically. For the
I am trying to vertically center one div (containing a search bar) inside another
I have 2 divs that I want to centre vertically inside another div. At
I have the following code: <html> <head> <style type=text/css> #test img {vertical-align: middle;} div#test
I'm trying to vertically center a div in the viewable area on a very
How do I assign vertical center alignment to the text inside a TextBlock? I
Possible Duplicate: How to make an image center (vertically & horizontally) inside a bigger
I have list items that displayed inline. I want to align them vertically inside

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.