• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 408
  • Last Modified:

Overlay Transparent Image

I have a php page that creates a schedule of classes as a table.  On that page, i would like to overlay the word "Cancelled" over the class name (in that cell), if the scheduling person cancels the class. (There would be an indicator field in the query that denotes the class is cancelled).  The schedule is done using a table that can grow and shrink based on the number of classes returned by the query to the database.  When the canceled indicator is set, I'd like the word "Cancelled" to be overlayed on the class name, but be transparent so you can still see the class name.  
I've searched the archives but haven't come up with anything.
My thought is to use a "DIV" somehow in the table cell where there is an if statement that would add the overlay.
Would greatly appreciate some help in figuring this out.
If you need any more info, please ask and I will try to provide it.

Thanks In Advance,
OldHatt45
0
OldHatt45
Asked:
OldHatt45
  • 2
  • 2
1 Solution
 
ovi_mihaiCommented:
try this.

it could have some problems with IE

I put a rotation too. on Firefox it looks great
<html>

<style>
td{font-size:30px;}
.trans{
position:absolute;
top:10px;
color: #17ADD7;
background: transparent;
filter: alpha(opacity= 50);
-moz-opacity: .50;
opacity: .50;

-webkit-transform: rotate(-15deg); 
-moz-transform: rotate(-15deg);	
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=4);
}
</style>
<body>
<table>
<tr>
	<td>content</td>
	<td>Class Name
		<div class="trans">CANCELED</div>
	</td>
	<td>content</td>
</tr>
<tr>
	<td>content</td>
	<td>content</td>
	<td>content</td>
</tr>

</table>
</body>
</html>

Open in new window

0
 
Slick812Commented:
greetings OldHatt45, , You might try two DIV, the outer with a RELATIVE style position, and the inner one with the canceled (text or image) with a ABSOLUTE style position.
In my table code below the
<div style="position:relative;">
and
<div style="color:f00;position:absolute;top:10px;left:10px;width:120;height:30px;">
may do something like what you need, adjusting the width and height to suit your needs
<table width="520" border="1">
<tr><td style="width:140px;">Class 101<br />intro PHP</td><td width="220">description of course</td><td>time 9:00 AM</td></tr>
<tr><td style="width:140px;"><div style="position:relative;">Class 102<br />mid PHP<div style="color:f00;position:absolute;top:10px;left:10px;width:120;height:30px;">CANCELED</div></div></td><td width="220">description</td><td>time 11:00 AM</td></tr>
<tr><td style="width:140px;">Class 103<br />advanced PHP</td><td width="220">description</td><td>time 2:00 PM</td></tr></table>

Open in new window

0
 
OldHatt45Author Commented:
ovi_mihai:

Interesting.  It does in fact do an overlay.
But if i simply add <div class="trans">Canceled</div> inside the second <td> in the second row, it does not place the Canceled text overlay in the correct cell.  It puts it in what looks like an absolute position.

I need it to go in the specific cell (with the class name) which could be row 2 or maybe row 10  or some other row, depending on the "canceled indicator" returned.  

I think the style that you created is using an absolute position which appears to be absolute to the screen and not absolute to the table cell.

Any other ideas????

Thanks,
OldHatt45
0
 
ovi_mihaiCommented:
try like Slick812 said.. with position: relative;

if it would be possible.. I recomand you to calculate the position it should be..
maybe you can make the table more stable.. fixed widths would be a big plus.

you will anyway have problems with diferent browsers
0
 
OldHatt45Author Commented:
Well done and SIMPLE!
Works lke a charm.

Thanks,
OldHatt45
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now