I've got an interesting problem here:
There is a table with a handful of cells, some of them have rowspans:
+----+----+----+----+
| | | c4 | cx |
| | c2 +----+----+
| | | c5 | cx |
| c1 +----+----+----+
| | | c6 | cx |
| | c3 +----+----+
| | | c7 | cx |
+----+----+---------+
When I hover over a row lets say the first row, I want to display it something like this
+----+----+----+----+
| c1 | c2 | c4 | cx |
| | +----+----+
| | | c5 | cx |
| +----+----+----+
| | | c6 | cx |
| | c3 +----+----+
| | | c7 | cx |
+----+----+---------+
So basically the values of the rowspan cells appear on the same row as the highlighted row.
Here is a jsfiddle with the highlighting working: https://jsfiddle.net/ucarL9e9/1/
So whenever I highlight a row I want to temporary change the vertical alignment of the cell to make it with the row that highlighted. So something like this:
I'm not worried about the color just the value of the cell.
EDIT
I got something working here but only want rowspan to be within its span
http://jsfiddle.net/jbb3f8yf/5/
So when I highlight the last row in the previous example in should be like this
+----+----+----+----+
| | | c4 | cx |
| | c2 +----+----+
| | | c5 | cx |
| +----+----+----+
| | | c6 | cx |
| | +----+----+
| c1 | c3 | c7 | cx |
+----+----+---------+
You can do this using JQuery
DEMO
JS
CSS
Do you only want this behaviour to occur in columns which contain a
rowspan
attribute when you hover over the first row?If so, you simply need:
Ah, wait, I've seen your update. This behaviour has to occur for every row, right?
Let me come up with something more sophisticated...
As promised, here is something more sophisticated.
The setup below ensures that, as you state above: