I have an array of 35 names which I want to display in alphabetical order such that:
Code: Select all
<tr><td>$arrayї0]</td><td>$arrayї18]</td></tr>
<tr><td>$arrayї1]</td><td>$arrayї19]</td></tr>
...
<tr><td>$arrayї17]</td><td> </td></tr>The difficulty I have is in sorting the array so that values appear in the right order.
After sorting alphabetically I need to break up the array into 2 columns like a card dealer would mix a deck of cards.
For future re-use purposes the function would do the same for any number of columns so if I changed the table layout from 2 to 3 cols then the function should make three lists when iterated through.
Seems like a good candidate for an already existing array function but I'm not certain if something exists and nothing screams at me as being obvious when looking through the manual.
I know I could break the information into 2 tables but then the rows wouldn't necessarily line up so this is not an option.
Well, is there a quick way of doing this with existing functions?