我使用创建了三列和三行li
;我想li
按 id 在每个订单中显示一个成员。
<li> // Style: margin-bottom:10px;
Show first member result here...
</li>
<li class="middle_li"> // Style: margin:0px 10px 10px;
Show second member result here...
</li>
<li> // Style: margin-bottom:10px;
Show third member result here...
</li>
<li> // Style: margin-bottom:10px;
Show first member result here...
</li>
<li class="middle_li"> // Style: margin:0px 10px 10px;
Show second member result here...
</li>
<li> // Style: margin-bottom:10px;
Show third member result here...
</li>
<li> // Style: margin-bottom:10px;
Show first member result here...
</li>
<li class="middle_li"> // Style: margin:0px 10px 10px;
Show second member result here...
</li>
<li> // Style: margin-bottom:10px;
Show third member result here...
</li>
我的PHP代码:
<?php
require 'initialize.inc.php'; // Classes: connection & members
echo '<ul>';
$members = $member->display_members();
foreach ($members as $member)
{
$html_ouput = '<li>';
$html_ouput .= 'Show member result here...';
$html_ouput .= '</li>';
echo $html_output;
}
echo '</ul>';
?>
此 php 代码显示九个结果。三列三行,但我怎样才能给每第二li
行一个中间类?我的php代码有任何修改吗?我不想使用 javascript。