Note that there are some explanatory texts on larger screens.

plurals
  1. POTable's columns width changes after adding another page to tr using ajax
    primarykey
    data
    text
    <p>I have a problem which is hard to explain I hope you will understand and help me, I have a table which produce rows dynamically, when a row is pressed it shows a page containing some information, the problem is that when I press on the row and the info page is shown the columns width is changed and the entire table shifts (all the widths). I have noticed that it happens after the info page is loaded but can't figure out why...</p> <p>CODE: this is where I post the table:</p> <pre><code>echo "&lt;table border=\"0\" width=\"100%\" cellspacing=\"0\" align=\"center\" class=\"result_table\" id=\"result_table\"&gt; &lt;tr align=\"right\" bgcolor=\"red\"&gt; &lt;th bgcolor=\"#cccccc\" align=\"right\" &gt;עיר&lt;/th&gt; &lt;th bgcolor=\"#cccccc\" &gt;רחוב&lt;/th&gt; &lt;th bgcolor=\"#cccccc\" &gt;מספר בית&lt;/th&gt; &lt;th bgcolor=\"#cccccc\" &gt;מחיר&lt;/th&gt; &lt;/tr&gt;"; foreach($types as $data){ echo $data['id']; echo "&lt;tr onClick=\"waiting_for_post(".$data['id'].");\" class=\"search_row\"&gt;"; echo "&lt;td align=\"right\" width=\"25%\"&gt;"; echo $data['city']; echo "&lt;/td&gt;"; echo "&lt;td align=\"right\"&gt;"; echo $data['street']; echo "&lt;/td&gt;"; echo "&lt;td align=\"right\"&gt;"; echo $data['house']; echo "&lt;/td&gt;"; echo "&lt;td align=\"right\"&gt;"; echo $data['price']; echo "&lt;/td&gt;&lt;/tr&gt;"; echo "&lt;tr class=\"info_row\" style=\"width:100%\"&gt;&lt;td colspan=\"4\"&gt;&lt;div id=\"div_num_".$data['id']."\" style=\"height:0px\" &gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;"; function waiting_for_post(apart_id){ var div = document.getElementById("div_num_"+apart_id) var xmlhttp = createXmlHttpRequestObject(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { var responseText = xmlhttp.responseText; div.innerHTML = responseText; div.style.visibility = 'visible'; div.style.height= "225px"; div.style.width="100%"; } } xmlhttp.open("GET","publish_data.php?id="+apart_id,true); xmlhttp.send(); } </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