我試圖重新設計一個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