php - How can I split this dynamic list into 3 columns? -


i'm working older web app, , aside rewriting modern standards i'm trying make modifications simple possible.

as can see below have dynamically created list of directory. code works can't figure out best way can split list 3 columns. i'm limited having thing work in ie9 (if works on other browser that's plus). nested tables mess, know, that's how thing built, i'm trying modify dynamic directory listing (with couple checkboxes).

is there php this? or there css techniques can work? i'm bit lost on work blast past.

           <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 &quot;p&quot; drive permissions - <br>               default users have @ <em>least</em> &quot;read-only&quot; access folders/files on &quot;s&quot; 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 $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> 

it's going depend on how want them flow.

what i'm not seeing in loop <li> tags. amend loop follows:

foreach ($directories $directory){   if ($directory === '.' or $directory === '..') { continue;  }   if (is_dir($path . '/' . $directory)){     echo '<li><input type="checkbox" name="read[]" value="' . $directory . '" />r</li>';     echo '<li><input type="checkbox" name="write[]" value="' . $directory . '" />w</li>';     echo '<li>' . $directory . '</li>';   } } 

now, have markup play around with. there, can apply styling adjust rows or columns, given mark structure resembles:

html

<ul class="dir-1">   <li><input type="checkbox" name="read[]">r</li>      <li><input type="checkbox" name="write[]">w</li>   <li>dir-1</li> </ul> <ul class="dir-2">   <li><input type="checkbox" name="read[]">r</li>      <li><input type="checkbox" name="write[]">w</li>   <li>dir-2</li> </ul> 

css

ul[class^="dir-"],  ul[class*=" dir-"] {   padding: 0;   margin: 0;   clear: both; } ul[class^="dir-"] li,  ul[class*=" dir-"] li {   display: inline-block;   width: 32%;   float: left;   margin-right: 1%; } 

http://codepen.io/anon/pen/aogodg


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -