I’m using CodeIgniter and I want to display a list of cities in multiple columns in html like this where i can just adjust the number of items inside the <ul> tag and then generate another <ul> tag for the next column
----------------
City name 1 City name 5 City name 9
City name 2 City name 6 City name 10
City name 3 City name 7
City name 4 City name 8
-------------------
I dont know how to make it display like that but here’s my current code that just display everything in 1 column.
<ul>
<?php
foreach($row_city as $city):
echo "<li>".anchor("#",$city->city_name)."</li>";
endforeach;
?>
</ul>
You don’t need to use tables. Simply use this code:
and just float the lists next to each other.