{source}
<?php$db = JFactory::getDbo();
$alias = "";
$query = $db->getQuery(true);
$query->select('*')->from('sg_distributor');
$db->setQuery($query);
$result = $db->execute();
$row = $db->loadObjectList();
?>
<link rel="stylesheet" type="text/css" href="/js/datatable/jquery.dataTables.css">
<script type="text/javascript" src="/js/datatable/jquery.dataTables.js"></script>
<table id="distributor" class="display"><thead>
<tr>
<th>Distributor</th>
<th>Region</th>
<th>Country</th>
<th>Phone</th>
<th>Web</th>
</tr>
</thead>
<tbody>
<?php foreach($row as $object){
$web = "";
$web = $object->web;
$web = str_replace(' ', '', $web);
echo '<tr>';
echo '<td>'. $object->distributor . '</td>';
echo '<td>'. $object->region . '</td>';
echo '<td>'. $object->country . '</td>';
echo '<td>'. $object->phone . '</td>';
echo '<td><a href="https://'. $web .'" target="_blank" >'. $web . '</a></td>';
echo '</tr>';
} ?>
</tbody>
</table>
<script type="text/javascript">
( function($) {$('#distributor').DataTable();
} ) ( jQuery );
</script>
{/source}