how to display images in datatables ?
how to display images in datatables ?
ayaradwan
Posts: 2Questions: 1Answers: 0
I get an array from database and pass it to datatables and it works good (Y) BUT IF this array contain picture's URL,SO how ca I show it in datatables??
$data_set = "[";
$count_rows = count($objects);
$count = 1;
foreach($objects as $object){
$data_set .= "['". $object['reportID'] ."', '". $object['email'] ."', '". $object['date'] ."', '". $object['time'] ."', '". $object['BasketID'] ."', '". $object['notifyEmployee'] ."','". $object['replyedPhoto'] ."']";
if($count != $count_rows){
$data_set .= ",";
$count++;
}
}
$data_set .= "]";
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You just need to modify your data output to include whatever HTML you require in the cells. DataTables will show it as it just writes the value to the
innerHTML
property of the cell.Allan
I solved by writing the <img src > in my function