Limit on rows |
[eluser]alberto24[/eluser]
Hi - I am struggling with an issue... I want to pull say 1,000 images from a database - I can do this part. Where I am stuck is that I want to show 5 images on each line then 5 on the next and so on. I assume I can use an html table but how do I set the view to show 5 then break to a new table row? Also - I'd like to do a pagination - is there a good tutorial for this? I've read a few that seem to work a bit differently. Thanks!
[eluser]Dam1an[/eluser]
If you use the HTML table class you can pass it an array of data (the images in this case) and set to to do 5 columns (see the make_columns function) As for the pagination, a good place to start is also the user guide, with a tutorials here Hope this helps
[eluser]alberto24[/eluser]
thank you for the quick reply - will look into the html class
[eluser]alberto24[/eluser]
not sure that html table class will work - in the db I have 1.jpg, 2.jpg, etc. I need it to include an img tag around that so images display. I also want the images to be clickable to the page for that image. will keep looking...thanks
[eluser]Dam1an[/eluser]
you could always just make the table yourself Have a foreach look over the db results, and have a counter as well If the counter modulo 5 is 0, start a new row and carry on as normal Something like Code: $i = 0;
[eluser]learning_php[/eluser]
Hi, Here is how I have done it for a basic Image Gallery loading images from a file not database, It's way from being perfect but it might give you a start: Code: <?php |
Welcome Guest, Not a member yet? Register Sign In |