sudeep acharya sudeep acharya - 1 year ago 47
HTML Question

Arrange data in tables?

I retrieve the data from the database and tried to implement them in the table. But now i don't know how to arrange them in the view is.

<?php include('inc/header.php');?>

<div class="main">





<?php foreach ($view as $row) :?>

<?php $i = 1;?>
<?php echo "<td>".$row->audio."</td>";?>
<?php echo $i++;?>
<?php endforeach;?>



<?php include('inc/footer.php');?>

i just want to make the place id increase from one to the as many records and arrange them into one table.but it is

Answer Source

Your foreach loop should be like this

    $i = 1;
    foreach ($view as $row)
        echo "<tr>";
        echo "<td>".$i."</td>";
        echo "<td>".$row->audio."</td>";
        echo "</tr>";

And <thead> should be

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download