I want to display a text file on a table and assign some code for each record.
- I can display the text file
- I can assign the code for each record (not yet finish as still under development.)
However, I came to a problem. The table column is not match up for some reason.
This is what happened. Heading 3 (Pink colour) the fields do not match the table.
Below is my code:
<table border='1'>
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
<th>Heading 3</th>
</tr>
<?php
$file=file('number.txt');
foreach($file as $value){
$items = explode(" ", $value);
echo "<tr>";
echo "<td>$items[0]</td>";
echo "<td>$items[1]</td>";
}
include("connect.php");//connect to the database.
$sql = mysql_query("select * from code5 where Status='Active' LIMIT 8");
if (mysql_num_rows($sql) > 0)
{
while ($row = mysql_fetch_array($sql))
{
echo "<td>$row[Code]</td>";
echo "</tr>";
}
}
?>
</table>
can someone spot what am I missing? or give me a hand on moving the table column?
Do I have to implement a CSS file to adjust it manually?