I have a list of items sorted alphabetically:
mylist = [a,b,c,d,e,f,g,h,i,j]
I can display the list in the html table horizontally, for example:
| a , b , c , d | | e , f , g , h | | i , j , , |
Which algorithm for creating a table vertically looks like this:
| a , d , g , j | | b , e , h , | | c , f , i , |
I use python, but your answer can be in any language or even pseudo-code.