I have this code which creates buttons from files in a directory. I need to organize them in a table with 4 columns. How can I do this?
Here is my code:
$handle = opendir('mydirectory');
if($handle){
while(($entry = readdir($handle)) !== false){
if($entry != '.' && $entry != '..' && $entry != '.htaccess'){
echo "<button onclick=\"location.href='mydirectory/$entry'\" style=\"background-color: #660000;\"><p style=color:white;>$entry</button><br>";
}
}
closedir($handle);