If I have a HTML table like the one below:
<table bgcolor="#151515" height="100" width="200">
<tr>
<td>
Hello
</td>
</tr>
</table>
How can I make it partially transparent? Is there a way of doing it without CSS? If not what is the CSS way?
You can try this in your html file:
<table class='table1'>
<tr><td>...
And this in your css file:
.table1 {
background: rgba(255,255,255,0.5);
}
This sets the rgba RED GREEN BLUE ALPHA values, 255,255,255 = white, 0,0,0 = black, and the 0.5 value at the end (ALPHA) is between 0 and 1, where 1 is opaque and 0 is transparent. I hope this helps.
In your case, #151515 (HEX CODE) translates to (21, 21, 21, 0.5) (RGBA) where A is equal to 50% transparent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With