Been struggling with this one!!! (just started php a couple of days ago- so still hopeless)
Only been at php for a couple of days so please excuse the clumsy programming.
I'm fetching data from mysql, and trying to display it in a table. This version is the best I've come up with so far - but really need to be abe to set maximum column widths and wrap text accordingly.
Any thoughts?
I've included the php part, and also the general format I want the display table to look like.
$query = mysql_query("SELECT * FROM file_notes WHERE claim_number=$claim_number ORDER BY fileid DESC")
or die (mysql_error());
$result = mysql_query($query);
$color1 = "#ebebeb";
$color2 = "#dddddd";
$row_count = 0;
echo "<table class='listing'>";
while($row = mysql_fetch_array($query)) {
$row_color = ($row_count % 2) ? $color1 : $color2;
echo "<tr valign='top'><td class='listing' bgcolor='" . ($row['claim_number'] == 'yes' ? '#33ccff' : $row_color) . "'>";
echo '<a href="case_note_update?claim_number='.$row['claim_number'].'">';
echo $row['claim_number'];
echo '</a>';
echo "</td><td class='listing' bgcolor='" . ($row['file_note'] == 'yes' ? '#33ccff' : $row_color) . "'>";
echo $row['file_note'];
echo "</td><td class='listing' bgcolor='" . ($row['action_plan'] == 'yes' ? '#33ccff' : $row_color) . "'>";
echo $row['action_plan'];
echo "</td></tr>";
$row_count++;
}
echo "</table>";
?>
and the prefered table style is...
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="76%" id="AutoNumber1">
<tr>
<td width="13%" align="center" valign="top">Claim Number</td>
<td width="37%" align="left" valign="top"> File Note<p> </td>
<td width="50%" align="left" valign="top">Action Plan Here</td>
</tr>
</table>
any help would be appreciated!!