title: rendering content in a gsp template
body: <p>I am new to grails, I want to write the content of html table 'cart_table' (currently in a shoppingcart.gsp) to a _carttemplate.gsp and show this table in another gsp (like summary.gsp) by include this new template. </p>
  
  <p>Currently I have the table defined in shoppingcart.gsp as follows:</p>
  
  <pre><code>&lt;table id="newTable" style="display:none"&gt;
      &lt;thead&gt;&lt;th&gt;item name&lt;/th&gt;&lt;th&gt;desc&lt;/th&gt;&lt;th&gt;business justification&lt;/th&gt;&lt;th&gt;start date&lt;/th&gt;&lt;th&gt;end date&lt;/th&gt;&lt;/thead&gt;
      &lt;tbody&gt;&lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>and I populate the body as follows</p>
  
  <pre><code>$("#confirmbutton").click(function(){
          var ntr='',//to store html for new table row
           rows=[],//to collect new rows
          $tbl=$("#table_rolecart tbody"),//original table
          l=$("tr", $tbl).length;//length of rows in original table's tbody section
          var row, brow, drow;
          :
          : /* getting rows from other tables */
          }
          $("#newTable tbody").append(rows.join(''));
  </code></pre>
  
  <p>How do I put the table into the template.gsp? and in the confirm page how do I display the table?</p>