z-index only works on absolutely positioned elements. You could try setting position: absolute
and then using the top, right, bottom, left
styles to position the elements on top of each other.
You could also try putting the <div> in front of the table in the markup, set float: left
on the div, and them move the table left, to position it on top of the div, by using a negative margin-left
value.
For example:
<div id="d1"></div>
<div id="d2"></div>
Using the following CSS, the second div would be 50px into the first div.
div {
width: 100px;
height: 100px;
border: solid 1px rgb(0, 0, 0);
}
#d1 {
float: left;
background-color: rgb(255, 0, 0);
}
#d2 {
float: left;
margin-left: -50px;
background-color: rgb(0, 255, 0);
opacity: 0.5;
}
The second div there would be your table. Just easier to demonstrate with divs :)