【发布时间】:2015-08-19 15:38:24
【问题描述】:
我正在使用一个较旧的网络应用程序,除了将所有内容重写为现代标准之外,我还试图使修改尽可能简单。
正如您在下面看到的,我有一个动态创建的目录列表。该代码有效,但我想不出将列表拆分为 3 列的最佳方法。我仅限于让这个东西在 IE9 中工作(如果它在任何其他浏览器上工作,那只是一个加号)。嵌套表是一团糟,我知道,但这就是它的构建方式,我只是想将它修改为我们的动态目录列表(带有几个复选框)。
是否有一些 PHP 可以做到这一点?或者是否有一些可以工作的 CSS 技术?我只是有点迷失在过去的爆炸中什么会起作用。
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#808080">
<tr>
<td>
<table width="100%" border=0 cellpadding=0 cellspacing=0>
<tr align="center" bgcolor="#000000">
<td valign=bottom class="style6 Normal"><strong>Watertown Network Shared Directory Access<br>
Applies to "P" drive permissions - <br>
By Default all users have at <em>least</em> "read-only" access to all folders/files on the "S" drive. </strong></td>
</tr>
<tr>
<td align="left"><table width="100%" border="0">
<?php
//$path = '\\\\wttfs001\\private';
$path = '\\\\wttfs001\\shared';
$directories = scandir($path);
echo '<ul>';
foreach ($directories as $directory){
if ($directory === '.' or $directory === '..') {
continue;
}
if(is_dir($path . '/' . $directory)){
echo '<input type="checkbox" name="read[]" value="' . $directory . '" />R';
echo '<input type="checkbox" name="write[]" value="' . $directory . '" />W';
echo ' ' . $directory . '<br>';
}
}
echo '</ul>';?>
</table></td>
</tr>
</table>
【问题讨论】:
-
你想让一行看起来像:“checkbox”“checkbox”“string”吗?
-
是的。有一个读写复选框,后跟目录标题。
标签: php html css multiple-columns