我试图重新设计一个Web应用程序,我得到的代码块难倒了HTML的PHP代码:重新设计页面:改变产生
foreach ($this->cells1 as $c) {
$s .= $c[2] ? $c[2] : '';
$s .= '<div style="clear:both"><table><tr><td nowrap="nowrap"' . ($c[0] ? (' ' . $c[0]) : '') . '>';
$s .= $c[1] ? $c[1] : ' ';
$s .= '</td>';
$s .= $c[3] ? $c[3] : '';
}
$s .= '</tr></table></div>';
它生产的HTML代码,例如:
<div style="clear:both"></div>
<table>
<tbody>
<tr>
<td nowrap="nowrap">Search:</td>
<form action="some-action" method="post"></form>
</tr>
</tbody>
</table>
<div style="clear:both"></div>
<table>
<tbody>
<tr class="alt-row">
<td nowrap="nowrap">
<input type="text">
</td>
</tr>
</tbody>
</table>
<div style="clear:both"></div>
<table>
<tbody>
<tr>
<td nowrap="nowrap"> </td>
<form action="some-action" method="post"></form>
</tr>
</tbody>
</table>
and so on. . . .
,它看起来像这样:
我只是想让他们都在一个div,我可以风格我的口味。任何人都可以向我解释那段代码,以便我可以使用它吗? 或者更好的还是让我看看如何让它们适合于div。
如果我能提供任何意见,这将是从这样的事情移开。该代码几乎不可读。 – andy 2013-03-18 09:56:59