title: Javascript - Dynamically populate a table (datatables)
body: <p>Two beginner javascript/web design questions rolled into one. I am using twitter bootstrap and I bought two templates to help figure it out and achieve the functionality i want. Both templates provide dynamic tables based on Datatables (ref: <a href="http://www.datatables.net/" rel="nofollow">http://www.datatables.net/</a>). Both provide examples with hardcoded data. I am  looking to dynamically populate the table using JSON data from a server request</p>
  
  <ol>
  <li><p>One table example has all columns populated, I would like to add an extra column with buttons to perform actions. I am unsure how to do this correctly as the server request will  only return data for say 4 columns but I would like to add a new column with buttons for every row. My first though was to have placeholder data in our JSON data which could be replaced with</p>
  
  <p><code>$('tr last-child').html("&lt;a class-btn&gt;");</code></p></li>
  </ol>
  
  <p>or something similar. Is this a good solution? Any ideas would be appreciated.</p>
  
  <ol>
  <li>The second template already has a column with buttons, also filled with hard coded data. IN this case what is the correct way to handle populating this table as the server call will return JSON data with 4 columns of data but the table will have 5 columns (one row of buttons).</li>
  </ol>
  
  <p>Any tips much appreciates.</p>
  
  <p>Cheers</p>