I have simple table in my codeigniter site like below
<table class="table">
<thead>
<tr>
<th>Time</th>
<th>Image</th>
<th>Username</th>
<th>Comment</th>
<th>Action</th>
</tr>
</thead>
<tbody id="ajax_table">
</tbody>
</table>
and I am displaying row like below
public function getComment(){
$page = $_GET['page'];
$user_id =$_GET['user_id'];
// $data['comments'] = $this->member->get_all_comment($user_id);
$comments = $this->member->get_all_comment($page,$user_id);
$html='';
if(isset($comments) && count($comments)>0){
foreach($comments as $comment){
if($comment->image ==""){
$image = "https://granboardonline.com/uploads/empty.jpg";
}
else {
$image = "https://granboardonline.com/uploads/".$comment->image;
}
$html.= "<tr><td>".$comment->date_created."</td><td> <img src= $image style='width:50px;height:50px;'> </td><td>".$comment->fname."</td><td>".$comment->comment."</td>";
if($this->session->userdata('user_id')==$comment->reciver_id || $this->session->userdata('user_id')==$comment->sender_id){
$html.="<td><button class='btn btn-light btn-sm deletecomment' comment_id='".$comment->comment_id."'>Delete</button></td></tr>";
}
}
}
echo $html;
exit;
}
But my comment column's row going outside and looking very bad, How I can show it fit to column?
Thanks!