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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:54:19+00:00 2026-06-14T15:54:19+00:00

I asked a question earlier about a way of highlighting tables using JavaScript and

  • 0

I asked a question earlier about a way of highlighting tables using JavaScript and `CSS. I’m having difficulty ensuring that the borders of the table look ok.

For example, in my table border I have set the margin to be 0. When hovering on a column, the increased border size causes the overall table to “jump” slightly. To prevent this I tried to resize the table cells but this does not make a difference.

enter image description here
enter image description here

I’m illustrating the problem with a JSFiddle here: http://jsfiddle.net/grNr8/6/. It’s a little hard to see in these images but hopefully the fiddle illustrates the issue.

My CSS is the following:

table, td {
    background-color: white;   
    border: 0px solid white;
    border-collapse: collapse;   
}

When highlighting the column, a border of pixel thickness 2 is chosen. I tried experimenting with changing the cell size using $('td').css({height: '29px'}); (and varying from 26 - 29) but it does not change the effect. The Javascript I am using to highlight is based mainly on an answer to my previous question:

$('td').hover(function() {
    var t = parseInt($(this).index()) + 1;
    $('td:nth-child(' + t + ')').first().addClass('highlightedTop');
    $('td:nth-child(' + t + ')').addClass('highlighted')
    $('td:nth-child(' + t + ')').last().removeClass('highlighted').addClass('x');

    $('td').css({
        height: '39px'
    });

    if (t > 1) {
        var t1 = t - 1;
        $('td:nth-child(' + t1 + ')').addClass('highlightedPrev');
        $('td:nth-child(' + t1 + ')').last().removeClass('highlightedPrev');

    }
}, function() {
    var t = parseInt($(this).index()) + 1;
    $('td:nth-child(' + t + ')').removeClass('highlighted ');
    $('td:nth-child(' + t + ')').first().removeClass('highlightedTop');
    $('td:nth-child(' + t + ')').last().removeClass('highlightedBottom');
    $('td:nth-child(' + t + ')').last().removeClass('x');
    if (t > 1) {
        var t1 = t - 1;
        $('td:nth-child(' + t1 + ')').removeClass('highlightedPrev');
    }
});​

Is it possible to resize the cells for smoother viewing, or should I be using a different approach? I have experimented with using a white border thickness of 1px but I end up with strange joins at the corners and un-symmetric borders at the extremities.

  • 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-14T15:54:21+00:00Added an answer on June 14, 2026 at 3:54 pm

    If outline doesn’t work for you, using a 2px solid transparent border on the default state can also work:

    table, td {
        background-color: white;   
        border: 2px solid transparent;
        border-collapse: collapse;   
    }
    

    http://jsfiddle.net/grNr8/7/

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

Sidebar

Related Questions

Earlier today, I asked a question about the way Python handles certain kinds of
This is related to this question I asked earlier about syntax highlighting user-defined blocks
i had asked earlier about the same kind of question but that was in
I asked a question earlier about the best way to put edit/delete links inline
I asked a simialr question earlier about using jquery and hashtags but what I
I asked a question earlier today about log4j and was told that it is
I asked this question earlier about testing a controller action and verifying that a
I asked a question earlier today about singletons, and I'm having some difficulties understanding
So ive asked question earlier about having some sort of social network website with
I asked a question earlier about why left joins in Linq can't use defined

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.