Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, I think the problem is in the fact that you try to use a static value for the column width (you specify 200px) and than you assign a width of 100% to the table. </p> <p>You ask two very different things to the browser I think. It have to stretch the widths in some manner. </p> <p>The other problem is in the definition of the borders, paddings and margins: you don't exactly know (or you don't take into account) how the browser draws the borders/paddings/margins, so you can't specify precise values.</p> <p>if you want to transform your table in a static one, you can use something like this:</p> <pre><code>&lt;html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;item List&lt;/title&gt; &lt;script type="text/javascript"&gt; &lt;!-- function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == '') { e.style.display = 'block'; } if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //--&gt; &lt;/script&gt; &lt;style&gt; table{ background-color: black; } td{ background-color: white; margin: 0; padding: 2px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="root"&gt; &lt;table cellspacing="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td width="200"&gt; &lt;p&gt;&lt;a href="#" onclick="toggle_visibility('itemAAA');"&gt;itemA&lt;/a&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="200"&gt;Feild2&lt;/td&gt; &lt;td width="200"&gt;Feild3&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3"&gt; &lt;div id="itemAAA"&gt; &lt;table cellspacing="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td width="196"&gt; &lt;p&gt;&lt;a href="#" onclick="toggle_visibility('itemAA');"&gt;itemAA&lt;/a&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="200"&gt;Feild2&lt;/td&gt; &lt;td width="196"&gt;Feild3&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3"&gt; &lt;div id="itemAA"&gt; &lt;table cellspacing="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td width="192"&gt; &lt;p&gt;itemAAA&lt;/p&gt; &lt;/td&gt; &lt;td width="200"&gt;Feild2&lt;/td&gt; &lt;td width="192"&gt;Feild3&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="200"&gt; &lt;p&gt;itemB&lt;/p&gt; &lt;/td&gt; &lt;td width="200"&gt;Feild2&lt;/td&gt; &lt;td width="200"&gt;Feild3&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>As you can see, I deleted the widths from the tables and I put som css in the cose. The widths of the columns are exactly calculated to take in account borders, margins and paddings.</p>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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