title: jquery datatable column for images
body: <p>I'm using php to generate the array and JSON encode it echoing it back to the javascript to render.</p>
  
  <p>JS isn't my forte by a long shot and I've found a couple of examples but they don't make sense to me.</p>
  
  <p>Sure the penny will drop with some direction and I'm sure its an easy one when I see it.</p>
  
  <pre><code>$(document).ready(function() {
              var dataTable = $('#result-grid').DataTable( {
                  "processing": true,
                  "serverSide": true,
                  "ajax":{
                      url :"searchdata.php", // json datasource
                      type: "post",  // method  , by default get
                      error: function(){  // error handling
                          $(".result-grid-error").html("");
                          $("#result-grid").append('&lt;tbody class="result-grid-error"&gt;&lt;tr&gt;&lt;th colspan="3"&gt;No data found in the server&lt;/th&gt;&lt;/tr&gt;&lt;/tbody&gt;');
                          $("#result-grid_processing").css("display","none");
  
                      }
                  }
              } );
  </code></pre>
  
  <p>The array comes in from with the first column as a url to the image for the colour the remaining columns are versions of that colour.</p>
  
  <p>So how do I make it so that the first column it renders the url as the image given from the array.</p>
  
  <pre><code>    Array
  (
  [0] =&gt; Array
      (
          [0] =&gt; http://red.jpg
          [1] =&gt; version 1
          [2] =&gt; version 2
          [3] =&gt; version 3
          [4] =&gt; version 4
      )
  
  [1] =&gt; Array
      (
          [0] =&gt; http://silver.jpg
          [1] =&gt; version 1
          [2] =&gt; version 2
          [3] =&gt; version 3
          [4] =&gt; version 4
      )
  
   )
  </code></pre>
  
  <p>I read through loads of pages but they don't fully make sense to me.. sure I'm just being thick!!</p>
  
  <p><a href="https://datatables.net/reference/option/columns.render" rel="nofollow">datatables render column</a></p>