2 つの for ループを出力する 10*10 の固定テーブルがあります。一部の画像はtable cell
、管理者から指定された行 ID と列 ID に一致する特定のウィッチに表示されます。
$table .= '<table border="1" cellspacing="0" cellpadding="2" class="banner_table">';
for($x=1; $x<=10; $x++) {
$table .= "<tr>";
for($y=1; $y<=10; $y++) {
$table .= "<td class='thumbnail'>";
if (isset($temp[$x][$y])) {
$count++;
$table .= "<a target='_blank' href='" . ($temp[$x][$y]['img_url'] ? $temp[$x][$y]['img_url'] : "#") . "'>
<img id='imgid' src='admin/small-image/" . $temp[$x][$y]['img_title'] . "' width='20' height='20' /></a>";
}
else $table .=" ";
$table .= "</td>";
}
$table .= "</tr>";
}
$table .= '</table>';
row id
与えられていないテーブルセルに 1,2,2... などのインデックス番号を指定するにはどうすればよいcolumn id
ですか? 同様に、インデックス番号 1 (ROW 1 AND COL1)、インデックス番号 2 (ROW1 および COL2) を指定します。
行IDと列IDから表のセル番号を取得する方法はありますか?