I'm using this code to populate a Table:
<style type="text/css">
table, td
{
border-color: #600;
border-style: solid;
}
table
{
border-width: 0 0 1px 1px;
border-spacing: 0;
border-collapse: collapse;
}
td
{
margin: 0;
padding: 4px;
border-width: 1px 1px 0 0;
background-color: #FFC;
}
</style>
<table>
<tr>
<th>Files</th>
</tr>
<?php
foreach(new DirectoryIterator('/home/nathanpc/public_html') as $directoryItem) {
if($directoryItem->isFile()) {
printf('<td><tr><a href="/%1$s">%1$s</a></tr></td>', $directoryItem->getBasename());
}
} ?>
</table>
But when I try it, what I got was values outside the table, and all disorganized. Here it is on the server: http://surl.x10.mx/list.php