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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:14:35+00:00 2026-06-16T20:14:35+00:00

I need a cursor that I can move between two cells in a table.

  • 0

I need a cursor that I can move between two cells in a table. Here is the jsFiddle: http://jsfiddle.net/KNc5u/

If you click on the table, the cursor will cycle between selecting the whole cell, selecting the bottom of the cell and the top.

As you can see, the table “jumps” while the cursor moves because the border width changes. This is ugly. How can I prevent this?

Constraints:

  • Cursor must be 2 pixel wide (not 1 and not 3)
  • Pure CSS preferred
  • No additional HTML elements, please (I could do this easily by wrapping each cell with a div with a 1 pixel white border that I turn black but I’m looking for a solution that doesn’t add junk to the DOM)
  • CSS3 is OK
  • I can live with IE10+ 🙂
  • 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-16T20:14:36+00:00Added an answer on June 16, 2026 at 8:14 pm

    As you said you’re ok with css3 you can fiddle with box-shadow: http://jsfiddle.net/KNc5u/10/

    This example works only with modern browsers and does not using any vendor prefixes like -moz or -webkit. If you need support other browsers you can easily add these prefixes to the existing box-shadow properties.

    Feel free to change the color keywords to your needs…

    td {
        text-align:center;
        border:1px solid blue;
        padding:1px 2px
    }
    
    .selected {
        display:block;
        border:none;
        box-shadow: inset 0 0 -2px 0 #000;
    }
    
    .selBottom {
        display:block;
        border:0;
        box-shadow: 0 0 black inset, 0 -2px red inset, 0 0 black inset, 0 0 black inset;
    }
    
    .selTop {
        display:block;
        border:0;
        box-shadow: 0 2px green inset, 0 0 black inset, 0 0 black inset, 0 0 black inset;
    }
    

    Update

    Here is a updated version (imho to hacky): http://jsfiddle.net/KNc5u/13/

    However it should fixe your issues for the provided markup. Note that there is a hint: This example will only work in a proper way with similar colors for td and your selected, selBottom and selTop classes.

    Update 2

    Now with left and right support: http://jsfiddle.net/KNc5u/15/

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

Sidebar

Related Questions

I need to verify a procedure that has an out cursor parameter. Specifically I
I need to get the size of rectangle of classical windows cursor. How can
I need to tweak UiTextField behavior so that I can programmatically insert some asterisks
I need the opposite information that the question How to get cursor position on
Actually i need to move the UIpopovercontroller while it's open but i found that
I need to pass an object that I can convert using $.parseJSON . The
I need to setup a hover button that can show a popup image when
Here's my application workflow. I have a ref cursor that is populated with all
I need to pass Cursor object to another activity, what is the best way
I need to change my mouse cursor to a custom image. If possible I

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.