Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter bootstrap buttons appearing on hover over the table row

I have a twitter bootstrap table with a button group in the last cell of each row.

button group in a table cell

I want these buttons appear only when user hovers over the row. Also, when user hovers over the row (not over the button group itself) only icons should appear, and when he then hovers over the button group icons should be displayed like buttons.

enter image description here

Here is a fiddle with html layout I use http://jsfiddle.net/hDafj/

And this is what I tried to do already http://jsfiddle.net/hDafj/2

like image 256
Devellar Avatar asked Jun 27 '13 09:06

Devellar


2 Answers

We can do this with just CSS

CSS

table.table tr td div.btn-group { display:none;}
table.table tr:hover td div.btn-group { display:inline-block;}

Here is the updated fiddle

like image 189
Praveen Gowda I V Avatar answered Oct 21 '22 13:10

Praveen Gowda I V


Well, I think that anyway you need some additional styles here. I've added .btn-group-hover class to make the buttons' borders, shadow and background white (this way they will always be the same size). All .icon-white icons also should be treated separately to avoid them appearing white on white background on row hover. Here is my suggested solution: http://jsfiddle.net/hDafj/3/ But the only issue here is that it looks good only on white tr background.

like image 28
Iurii.K Avatar answered Oct 21 '22 13:10

Iurii.K