Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1304 How can I place an absolute layer in a table cell?

You are here: irt.org | FAQ | JavaScript | DHTML | Q1304 [ previous next ]

Try:

<html>

<head>

<style type="text/css"><!--
.relative { position:relative;}
.absolute { position:absolute; }
//--></style>

<script language="JavaScript"><!--

function showByShadow(object,shadow) {
    if (document.layers && document.layers[object]) {
        document.layers[object].left = document.layers[shadow].pageX;
        document.layers[object].top = document.layers[shadow].pageY;
    }
    else if (document.all) {
        document.all[object].style.posLeft = document.all[object].offsetLeft;
        document.all[object].style.posTop = document.all[object].offsetTop;
    }
}

//--></script>

</head>

<body bgcolor="#ffffff" onLoad="showByShadow('myLayer','myShadow')">

<table width="100%" border="1"><tr><td width="50%">&nbsp;</td><td width="50%">

<p>
<span id="myLayer" class="absolute">
<p class="red">Some text within a layer</p>
</span>

<span id="myShadow" class="relative">
</span>
</p>

</td></tr></table>

</body>
</html>

©2018 Martin Webb