sudeep acharya sudeep acharya - 4 months ago 8
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


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