First, Welcome to PHPBuilder! Please use the [NOPARSE]
[/NOPARSE] tags when posting PHP code to make it easier to read.
As for your question.. the answer is easy, the code you provide is to show 3 results per row, as opposed to just one. If you only want one result per row this can be simplified greatly to:
<?php
$q = mysql_query("SELECT username, user_id FROM user") or die(mysql_error());
echo"
<table>
<tr>
<th> user id</th>
<th> username</th>
</tr>";
while($row = mysql_fetch_array($q)){
extract($row);
echo "<tr>
<td>$user_id</td>
<td>$username</td>
</tr>";
}
echo"</table>";
?>