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.

enter image description here

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: enter image description here

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>"; } 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -