SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Images not in rows - could use some help

    I hired a local freelancer to help out with some work and its not quite what I want. The project has dragged on and I want to finish it.
    Basically, the page is thumbnail images generated from a database.

    I want the thumbnail images in rows, preferably to stretch to 100% page width or if that is not possible then 4 or 5 images to a row, however right now each thumbnail is in its own row.
    I don't know php however I've been cleaning up other issues on these pages, but I don't want to mess up the code.

    The page is here - Todd White Fine Art Holywood Glamour Art

    The code for the thumbnails is here.
    <?
    include("global.php");
    include("header.php");

    $resource = mysql_query("select * from art WHERE artist = 'Todd White'");

    while ($row = mysql_fetch_array($resource)) {
    echo "<div id='gallery'>";
    echo "<a href='view.php?image=" . $row["image"] . "'>";
    echo "<img border=0 src='../folderimages/" . $row["thumb"] . "' /><br />";
    echo $row["title"] . "</a></div>";
    };

    ?>

    Is there any way to fix this? Thank you.

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    It initially looks like a styling issue.

    Change:
    Code:
    echo "<div id='gallery'>";
    To:
    Code:
    echo "<div class='gallery'>";
    Then add this to your CSS:
    Code:
    div.gallery { display: inline; }
    That should do it, I think!

    Anthony.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You could "float" them left too, but then you'd have to add something to clear the float.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks but neither of your suggestions worked.

  5. #5
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Here's a different solution, but this certainly belongs in the CSS forum.

    CSS Image Gallery

    Check out the source to see what's going on, but be warned, I don't do CSS.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  6. #6
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •