title: The width of a table row changes after I collapse and expand it
body: <p>I am new to Javascript and CSS, I try to expand/collapse table rows using JavaScript.</p>
  
  <p>And, I use CSS to change the style of my tables.</p>
  
  <p>Here comes my code snippet:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script&gt;
              function ShowSubTable(titleRow)
              {    
                  var nextRow = titleRow.nextSibling;
                  while (nextRow != null)
                  {
                      if( nextRow.tagName != 'TR' ){
                          nextRow = nextRow.nextSibling;
                          continue;
                      }
                      if (nextRow.style.display == 'none')
                      {
                          nextRow.style.display = 'block';
                      }
                      else
                      {
                          nextRow.style.display = 'none';
                      }
                      break;
                  }        
              }
          &lt;/script&gt;
          &lt;style&gt;
              table.tlb
              {
                  width: 100%;
              }
              table.tlb th
              {
                  background: #E8C993;
                  font-size: 22px;
              }
              table.tlb td
              {
                  background: #FFEAAF;
                  font-size: 16px;
              }
          &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;table class="tlb"&gt;
              &lt;tr onclick="ShowSubTable(this)"&gt;
                  &lt;th&gt;abc&lt;/th&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;123&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr onclick="ShowSubTable(this)"&gt;
                  &lt;th&gt;def&lt;/th&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;456&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The expand/collapse function works fine. But there is a problem.</p>
  
  <p>The width of my table is 100% at the beginning. However, after I collapse a table row and expand it. the width of the table row is not 100%.</p>
  
  <p>How to fix the problem?</p>
  
  <p>Thanks in advance.</p>