Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is the definitive working answer. I didn't need to create an extra parent DIV and name it id="place_here". Naming a table cell id="place_here" and making it the parent to DIV id="div_2" was enough. This is a brilliant little work around. Thanks!</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"&gt;&lt;head&gt; &lt;title&gt;test / crtp&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { position_mdiv()(); $(window).resize(function() { position_mdiv(); }); }) function position_mdiv(){ var pos = $('#place_here').position(); var width = $('#place_here').outerWidth(); $('#div_2').css({ position: "absolute", top: pos.top +2 + "px", left: (pos.left -300 + width) + "px" }); } &lt;/script&gt; &lt;body&gt; &lt;form id="CTRP_Form"&gt; &lt;table border="1"&gt; &lt;tr&gt; &lt;td&gt; &lt;div id="div_1"&gt;&lt;input id="fnam" name="fnam" form="CTRP_Form" type="text"&gt;&lt;input type=submit&gt;&lt;/div&gt; &lt;/td&gt; &lt;td id="place_here" style="background:yellow;width:300px;padding:0px;border:solid 2px #CCC"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; &lt;div id="div_2"&gt;&lt;form id="query_Form"&gt;&lt;input id="MyQuery" name="MyQuery" form="query_Form" type="text"&gt;&lt;input type=submit&gt;&lt;/form&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload