display items vertically

Posted by shawn swanson on Stack Overflow See other posts from Stack Overflow or by shawn swanson
Published on 2012-12-16T16:46:20Z Indexed on 2012/12/16 17:03 UTC
Read the original article Hit count: 149

Filed under:
|

This is my code:

<?php
while($fetch_cat = mysql_fetch_array($rescat))
    {
        $per_cnt++;
?>
        <li style="margin-left:10px;">
            <a href="sub_cat.php?cat_id=<?php echo $fetch_cat['cat_id'];?>" 
             style="color:#431603;text-decoration:none;"><?php 
             echo stripslashes($fetch_cat['category_name']);?> 
            </a>
        </li>
<?php
    }
?>  

This is the output I am getting- alphabetical order horizontally:

A B C
D E F
G H I
J

This is what I want to show- alphabetical order vertically:

A E H
B F I
C G J
D 

Please help.

Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about php5