I have a table with selectable cells (via jQuery-UI selectable). Cells are selected individually, via cmd/ctrl-clicking, and via lasso. Selected cells get the “ui-selected” class. I style the selection by adding a 1 pixel thick orange border to that class. This looks silly when contiguous cells are selected. Please see this fiddle to play with it: http://jsfiddle.net/derekprior/UxwD4/
What I’d like to do is draw the orange border only on sides where the neighboring cell is not also selected. By neighboring I mean both in the same row and in the row above and below. The result should be a single outline around the entre contiguous selection.
Can this be done with pure CSS? CSS3 selectors are fair game provided they are supported well enough in Firefox, Chrome, and Safari. If not, how about Javascript?
http://jsfiddle.net/UxwD4/14/