PHP と HTML を組み合わせたコードを次に示します。(4×4のテーブルを示しています。)
このコードを読みやすくするにはどうすればよいですか?
HTML のインデントを変更する場合は、HTML 全体を変更する必要があります。(このコードはソース全体の一部です。)
私に何か考えがありますか。私にお知らせください。タ。
<!-- GALLERY BEGIN -->
<tr>
<td style="padding-top:5px;"><table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<?php
$ii = 0;
$aRows = getArticle('board_table', $DB_CONNECT, 8);
foreach ($aRows as $iidx => $aRow) :
$ii++;
$U = getUpfiles('upload_table',$aRow[uid],'');
$pic = getImage($U);
?>
<td width="75"><table width="60" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="<?=$aRow[link]?>"><img src="<?=$pic?>"/></a></td>
</tr>
<tr>
<td align="center"><?=getStrCut($aRow[subject], 8, '..')?></td>
</tr>
</table></td>
<?php if($ii%4==0): ?>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<?php endif; ?>
<?php endforeach; ?>
</tr>
</table></td>
</tr>
<!-- END BEGIN -->