title: How to add if statement into datatables?
body: <p>I have datatables which is render image inside table but what I've done is just if there is image then render but if no image not yet have statement</p>
  
  <p><strong>here's my datatables</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function() {
      $('#pengumuman-table').DataTable({
          processing: true,
          serverSide: true,
          responsive: true,
          ajax: '{!! route('pengumuman.data') !!}',
          columns: [
              { data: 'rownum', name: 'rownum' },
              { data: 'gambar', render: function(data)
                  { return '&lt;img src="{{ asset("/images/pengumuman/") }}/'+data+'" atl img style="width:200px; height:150px"/&gt;' }
              },
              { data: 'nama_pengumuman', name: 'nama_pengumuman' },
              { data: 'created_at', name: 'created_at' },
              { data: 'action', name: 'action', orderable: false, searchable: false }
          ]
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>How do I add statement if no image in datatable like this in php</p>
  
  <pre><code>@if(isset($pegawai-&gt;foto) &amp;&amp; !empty($pegawai-&gt;foto))
    &lt;div align="center"&gt; 
    &lt;img src="{{ asset("/images/karyawan/$pegawai-&gt;foto") }}" alt="" img style="width:250px; height:260px"&gt;
    &lt;/div&gt;
  @else
    &lt;div align="center"&gt; 
    &lt;img src="http://www.blogsaays.com/wp-content/uploads/2014/02/no-user-profile-picture-whatsapp.jpg" alt="" img style="width:250px; height:260px"&gt;
    &lt;/div&gt;
  @endif
  </code></pre>