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 7166489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:25:20+00:00 2026-05-28T14:25:20+00:00

The best way to describe the issue would be by posting a jsFiddle, so

  • 0

The best way to describe the issue would be by posting a jsFiddle, so here it is.

And a screenshot for reference:

Reference screenshot

I have to put a div containing something within a td element, which has some formatting and height. The div cannot disrupt the cell’s height but itself is a little bigger than line-height within the cell, so the whole row’s height rises. It can be seen as the difference in height between the upper and lower tables on the screenshot.

Positioning the div relatively and moving it upward doesn’t help. My question is – is it possible to somehow position the div in the exact same place as in my example but without affecting the table row’s height?

Absolute positioning works as expected but has some flaws – the contents of the table and other elements of my page can change and therefore maintaining the proper position of the div would require monitoring it’s parent with JavaScript which wouldn’t be a very practical solution.

Thanks everyone for any help.

  • 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-28T14:25:21+00:00Added an answer on May 28, 2026 at 2:25 pm

    You can achieve the effect you’re looking for by wrapping the div inside the table cell with another div which is relatively positioned. Then change your div to be absolutely positioned.

    For some reason, jsFiddle, isn’t loading for me right now, so here’s the code.

    HTML

    <table class="some-table">
        <tr>
            <td>Cell 1</td>
            <td>
                Cell 2
                <div class="wrapper">
                    <div class="checkbox-div">
                        <input type="checkbox" id="checkbox"/>
                        <label for="checkbox">Label</label>
                    </div>
                </div>
            </td>
            <td>Cell 3</td>
        </tr>
    </table>
    <br/>
    <br/>
    <table class="some-table">
        <tr>
            <td>Cell 1</td>
            <td>Cell 2</td>
            <td>Cell 3</td>
        </tr>
    </table>
    

    CSS

    .some-table td {
        border: 1px solid black;
        padding: 5px;
        width: 200px;
        font-size: 10px;
    }
    
    .wrapper {
        position: relative;
        float: right;
        width: 200px;
    }
    
    .checkbox-div {
        border: 1px solid black;
        position: absolute;
        top: -20px;
        right: 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay I'll try describe this the best way I can. I have a chat
Best way to describe this is explain the situation. Imagine I have a factory
The best way of describing this is I have a table of people with
The best way to describe my website is to simply give you a link
I suppose the best way to describe the control, that I'm trying to make,
What is the best way to describe a commenting and voting process as we
I'm not sure the best way to describe what it is that I'm trying
I'm wondering what the best way to go about doing this is... I have
I'm not sure the best way to describe this. But I'm finding the image
the best way to explain is with example so: this is the model public

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.