| |||||||||||
| |||||||||||
Displaying data at 5 items per line on a web page
If you want to display a list of items in (say) 5 columns on a web page, use a table. A loop in PHP will let you generate all the table cells very easily, then add in a little extra code to deal with:
a) The very first cell (you need to open table and row) b) Every fifth cell (you need to start a new row) and c) The very last cell (you need to pad out the last row and close the table). Like an example? Working demonstration here Source code here (written 2006-08-14 05:27:32) Associated topics are indexed under H106 - PHP - Arrays
Some other Articles
Build on what you already have with OOPython - when to use the in operator Python makes University Challenge Old Wardour Castle Displaying data at 5 items per line on a web page Comparison of Object Oriented Philosophy - Python, Java, C++, Perl Butterflies in a Wiltshire garden Where to go within 30 minutes of Melksham Freedom of speech and freedom to post No news is good news with Unix and Linux 1637 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||