title: Add table row dynamically in apps script
body: <p>I have a table with two rows: first row is header and second row is like this...</p>
  
  <pre><code>&lt;tr&gt;
        &lt;td&gt;&lt;b&gt;1&lt;/b&gt;&lt;/td&gt;
        &lt;td&gt;&lt;input type="date" id="dt" name="dt"&gt;&lt;/td&gt;
        &lt;td&gt;&lt;input type="time" id="tmStart" name="tmStart"&gt;&lt;/td&gt;
        &lt;td&gt;&lt;input type="time" id="tmEnd" name="tmEnd"&gt;&lt;/td&gt;
        &lt;td&gt;&lt;select id="ddlTrainType" name="ddlTrainType"&gt;&lt;option&gt;Select Training&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" id="txtLoc" name="txtLoc"&gt;&lt;/td&gt;
        &lt;td&gt;&lt;select id="ddlProg" name="ddlProg"&gt;&lt;option&gt;Select Program&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;
        &lt;td&gt;&lt;select id="ddlTrainMod" name="ddlTrainMod"&gt;&lt;option&gt;Select Module&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;
        &lt;td&gt;&lt;select id="ddlTrainName" name="ddlTrainName"&gt;&lt;option&gt;Select Trainer&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;
        &lt;td&gt;&lt;select id="ddlStat" name="ddlStat"&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Completed&lt;/option&gt;&lt;option&gt;Cancelled&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <blockquote>
    <p>Note: all <strong>select</strong> tags drop-downs are populated from another google spreadsheet.</p>
  </blockquote>
  
  <p>Now, on button click(button like <strong>add row</strong>), I want to append a similar row like above to this table. </p>
  
  <p>Not only add a row, but also, in the end, let's say there are 5 rows in total and <strong>submit</strong> is clicked, then I want to store all 5 rows in a Google Spreadsheet.</p>
  
  <p>Any ideas how to do this?</p>
  
  <p>I already tried adding row with the help of code.gs file and reconstructing template using <code>HtmlService.createTemplate</code>. But this can only be used in <code>doGet(e)</code> I guess and cannot work with js button action.</p>
  
  <p>Let's say we create such dynamic table, but even after that, how do we pass all the table data from javascript to code.gs file?</p>