I'm trying to create an admin page for a small web site. My plan is to create a table for each user with the relevant data put into individual cells.
Here's my code right now:
foreach ($user_data as $key => $element)
{
echo <<<EOT
<div><table border="1" style="width:100%">
EOT;
foreach ($element as $subkey => $sub_element)
{
echo <<<EOT
<td>$sub_element</td>
EOT;
}
echo <<<EOT
</table></div>
EOT;
The problem is the cells in each table are of different length so the data does not line up nice and neat under the column headings (not shown here). I'm wondering if there is a way (using CSS?) to have each cell be a different, but specific, length using a variable for the width. I'm thinking I could just use a counter to keep track of which cell is being created and use a different width for each number in the counter (i.e. an array of 5 different lengths that are looped through along with the data).
Am I even approaching this the right way?