5
I have a dynamically generated table:
I would like to create a class in CSS to make a "layer" on top, with transparency.
Example:
If I use the background-color
, it will only change the background, so it would have to be something on top. Then it would not serve.
Table code is basic, are <tr>
and <td>
, so it makes no difference to post her code.
Painting the background and stirring the opacity of tr may give a very similar result. Have you tried?
– bfavaretto
So, but just change the background, the elements stay on top as I said about the
background-color
... unless it is otherwise, and/or has how to "up" the background of the<tr>
on top of the<td>
.– rbz
But you also touched the opacity of
<tr>
? By reducing the opacity, both the background and the content will be transparent, it may be close to the result you want.– bfavaretto
@bfavaretto I think that’s what the hugocsl replied... I think that was it
position: absolute;
that sends forward! Thank you!– rbz
Yes, his answer is the best way. Maybe it’s as generic as possible. I just don’t think it works without border-Collapse in the table.
– bfavaretto
@bfavaretto really he ran away from
<tr>
...– rbz
@bfavaretto exactly, if leaving the edge Collapse is a soft space between one cell and another....
– hugocsl
@bfavaretto I managed to do without clocar the border-Collapse in table :), although it is not very elegant... Check out the option 1 I edited in reply.
– hugocsl
Good @hugocsl. In this case gambiarra is valid, because it is not a trivial problem (as you know, you cannot violate the HTML syntax of the tables).
– bfavaretto
A form using JS: https://jsfiddle.net/zd3uwgsh/7/
– Sam
@That way you created a
<spam>
over the<tr>
, and so I don’t even need to change the CSS, just add the class to the<tr>
that I need to put to Arja, would that be?– rbz
Almost that. Just the class
.overlay
that you need to put in CSS, but if you don’t want to touch CSS you can put the properties directly inline in span by JS. As spans have position and fixed height, if you want it to be responsive, you need to add some more codes, but that would be no problem.– Sam
But in general that’s right, just put the class . Arja na tr que vc quer.
– Sam