Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    List item Allignment

    whats wrong with my code.



    <?php

    $Luzon = array("ML" => "Manila", "QC" => "Quezon", "SJ" => "San Juan");

    $Visayas = array("CB" => "Cebu", "IL" => "Iloilo", "BC" => "Bacolod");

    $Mindanao = array("DC"=> "Davao", "CDO" => "Cagayan De Oro", "BK"=>"Bukidnon");

    $Philippines = array("Luzon"=>$Luzon, "Visayas"=>$Visayas, "Mindanao"=> $Mindanao);

    foreach($Philippines as $Islands => $City)
    {
    echo "<H2>$Islands</H2>";
    echo "<ul>";
    foreach($City as $Code => $Name)
    {

    echo "<li>$Code - $Name</li>";
    echo " </ul>";
    }
    }
    ?>

    i want all the list items to be vertically straight.
    tnx for the help.

  • #2
    New Coder
    Join Date
    Dec 2008
    Location
    india
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can you post the forumat of the output how you need.

  • #3
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts
    without seeing the output its hard to tell, but i think what you want is to add a style to your ul

    like

    Code:
    echo "<ul style=\"margin-left:25px\"";
    or 
    echo '<ul style="margin-left:25px" ';
    that should put column lined up on the left for you


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •