php - Styling for an HTML table from database -
i need make results of query appears in table layout prototype showing below.
i want know how make picture on left. , sandwich name , price lined on top , description under it.
i'm using foreach echo query in table.
foreach ($rows $row) { echo "<tr>"; echo "<td><img src=" . $row["image_file"] . "></td>"; echo "<td>" . $row["productname"] . "</td>"; echo "<td>" . $row["description"] . "</td>"; echo "<td>" . $row["price"] . "</td>"; echo "</tr>"; }
mine showing this:
there several ways this: nested tables rowspan css
it depends on want.
rowspan
{ echo "<tr>"; echo "<td rowspan='2'><img src='" . $row["image_file"] . "'></td>"; echo "<td>" . $row["productname"] . "</td>"; echo "<td>" . $row["price"] . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2'>" . $row["description"] . "</td>"; echo "</tr>"; }