Question: I have a certain part of code that pulls numbers from a Mysql database and displays it into a HTML table using PHP. However, I have lots of data from this one row, over 100 lines easily, and I would like to split into columns by lengths of 25 or so. 

This is the code so far:

```
 while($row = mysql_fetch_array($results))
{
    echo "<tr>";
    echo "<td>" . $Destination = $row["Destination"] . "</td>";
    echo "</tr>";
}

```

Should I continue using a table or is there a better way to keep a nice format and split? This is going to be used for a web view, so I'd like to stick with CSS or HTML elements.

Answer: 
```
$i = 1;
echo "<tr>";
while($row = mysql_fetch_array($results))
{
    echo "<td>".$row['Destination']."</td>";

    if ($i % 25 == 0) echo "</tr><tr>";

    $i++;
}
echo "</tr>";

```
Try this:

```
<?php
$i = 1;
$columns = 25;
while($row = mysql_fetch_array($results))
{
    if($i == 1){ echo '<tr>'; }
    echo "<td>" . $Destination = $row["Destination"] . "</td>";
    $i++;
    if($i == ($columns + 1)) { echo '</tr>'; $i = 1; }
}
?>

```