This is the result I’ve got. But I wan to display it horizontally. Can anyone help me?
Here’s my code:
<?php
for($j = 0; $j < count($sub); $j++){
echo "
<table class='table'>
<thead>
<tr>
<th scope='col'>" . $sub[$j] . "</th>
</tr>
</thead>
</table>";
}
?>
>Solution :
Your subjects should be ths in one tr:
echo "<table class='table'><thead><tr>";
for($j = 0; $j < count($sub); $j++){
echo "<th scope='col'>" . $sub[$j] . "</th>";
}
echo "</tr></thead></table>";
Fiddle here.
