<!DOCTYPE html>
<html>
  <head>
    <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
    <link href="https://nightly.datatables.net/css/jquery.dataTables.css" rel="stylesheet" type="text/css" />
    <script src="https://nightly.datatables.net/js/jquery.dataTables.js"></script>
    <meta charset=utf-8 />
    <title>DataTables - JS Bin</title>
  </head>
  <body>
    <div class="container">
      <table id="example" class="display nowrap" width="100%">
        <thead>
          <tr>
            <th>Image1</th>
            <th>Image2</th>
            <th>Image3</th>
            <th>Image4</th>
          </tr>
        </thead>
      </table>
    </div>
  </body>
</html>
 
body {
  font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  background-color: #fff;
}
 
var data = [
  [
    '<img src="https://www.tutorialspoint.com/javafx/images/javafx-mini-logo.jpg">',
    '<img src="https://www.tutorialspoint.com/javafx/images/javafx-mini-logo.jpg">',
    "https://www.tutorialspoint.com/javafx/images/javafx-mini-logo.jpg",
    "https://www.tutorialspoint.com/javafx/images/javafx-mini-logo.jpg",
  ]
]
var table = new DataTable('#example', {
  data: data,
  columnDefs: [
    {
      targets: [2, 3],
      render: function (data, type, row) {
      return '<img src=' + data + '>';
    }
    }
  ]
});
1 error
Line 9: Missing semicolon.
Output

This bin was created anonymously and its free preview time has expired. Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers