I want to display different images in a 5 by 3 table.
W1 W1 W1
W2 W2 W2
W3 W3 W3
W4 W4 W4
W5 W5 W5
Here is my code
$ds ='\image';
$imagefile = array("EX_W1_01.png", "EX_W1_02.png", "EX_W2_01.png","EX_W3_01.png");
echo "<pre>"; print_r($imagefile);
$file = 'blank.png';
$d = $ds.$file;
echo "<table border = 1 width=\"540px\" cellspacing=\"0px\" cellpadding=\"0px\">";
for($row=1;$row<=5;$row++){
echo "<tr>";
for($col=1;$col<=3;$col++){
// echo"<td height=60px>W$row</td>";
//if()
echo"<td height=60px>W$row<img border = 1 height = 120 width = 120 src = $d ></td>" .PHP_EOL;
}
echo "</tr>";
}
echo "</table>";
?>
my desired table is to display the image base on the middle file name and blank.png if no name in the array
EX_W1_01.png | EX_W1_02.png | blank.png |
EX_W2_01.png | Blank.png | blank.png |
EX_W3_01.png | Blank.png | Blank.png |
Blank.png | Blank.png | blank.png |
Blank.png | Blank.png | blank.png |