as follows -
$database = JFactory::getDBO();
$database->setQuery("SELECT record,name FROM `#__tablename` ORDER BY id ASC");
$orderitems = $database->loadObjectList();
By the code it's easy to guess how to load data from table as
objects list in $orderitems.Then by the following way i loop
through the list and display each record(table row) data
<? if (count($orderitems)>0) { ?>
<div style="overflow:auto;border:1px solid lightgray;">
<table border="0" cellspacing="0" style="width:100%;">
<tbody class="bodycontent">
<?php
$cnt = 1;
foreach ($orderitems as $item) { ?>
<tr class="ms_row<?php echo ($cnt%2); ?>">
<td> <?php echo $item->record; ?></td> <td> <?php echo $item->name; ?></td>
</tr>
<?php $cnt++; } ?>
</tbody>
</table>
</div>
<? } else { ?> <div style="border:none;">No Items Found</div> <? } ?>
Hope it helps very much.