zerkms
zerkms

Reputation: 255035

Border, that overlaps near cells

That's how cell selection looks in MS Excel:

enter image description here

Is it possible to have the similar border in regular HTML <table> so that the border overlaps near cells (if you look closely you'll see that the border is extended for about 1px each side over near cells)?

Upvotes: 0

Views: 72

Answers (2)

derekerdmann
derekerdmann

Reputation: 18252

I don't know of a way to do it purely with tables, but one approach would be to use another div or text input that gets absolutely positioned over the table of data.

Here's a live example: http://jsbin.com/edehoc

I personally like this approach because it lets you use a familiar form element that has an expected style when it gains focus.

Upvotes: 1

jnpdx
jnpdx

Reputation: 52555

Yes, to a certain extent. I've only tested in Chrome, but this works: http://jsfiddle.net/q4Lcc/

td {
    width: 120px;
    height: 50px;
  border: 1px solid gray;  
}

td#test_td {
     border: 3px solid black;   
}

Upvotes: 3

Related Questions