You have to put the
tag and the table header line before the loop, put the output of the cells into the loop, and let the closing
tags after the loop.
I provided a similar answer yesterday at Database data not display plz solve this
<th>Username</th><th>First Name</th><th>Last Name</th>
<?php foreach ( $datas as $data ):?>
<td><?php echo $data->user_name;?></td>
<td><?php echo $data->fname;?></td>
<td><?php echo $data->lname;?></td>
You have more data columns than header columns. So you should add also the missing header columns (e.g. as empty cells).
I have also not added the cells with the links because I guess that
does not contain valid links but must be passed as parameters to an existing page.
See also Views — CodeIgniter 3.1.8 documentation