Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    automated creation of list of jpegs im html - how?

    having a bunch of jpeg images, i need to create a html table listing all the jpegs in a folder, like

    <td><img src="image1"></td>
    <td><img src="image2"></td>
    <td><img src="image3"></td>

    is there a small software or script so i could do it?
    finally i want to have something that looks like this:

    http://www.victorboyko.com/runway/ss...aakhmadullina/

    thank you!

  • #2
    Regular Coder kosstr12's Avatar
    Join Date
    Apr 2007
    Location
    Woodstock, Georgia
    Posts
    428
    Thanks
    7
    Thanked 5 Times in 5 Posts
    Fix the link to the example please.

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,790
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    I guess it’s this URL: http://victorboyko.com/runway/ss09/alenaakhmadullina/

    But one question is: Why does it need to be a table? This ain’t abular data and images align themselves horizontally anyway so no need for a table (with just one row and an endless amount of columns). You’ll just have to put the images and space them with on line of CSS. I don’t even think if you need an automatic script for that (and I don’t know any) but a regular HTML editor with search and replace function might do it as well.

  • #4
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    The automation needs to be server-side. Might help:
    PHP Code:
    <table>
    <tr>
    <?php
    $dir 
    'images/'// Base directory

    // Open a known directory, and proceed to read its contents
    if (is_dir($dir)) // If directory exist
    {
        if (
    $dh opendir($dir)) // If assignment successful
        
    {
            while ((
    $file readdir($dh)) !== false// While there's still a file
            
    {
            if(
    $file!='.'&&$file!='..'// I don't want to see the gibberish
                
    echo "<td><img src='$dir$file' alt='$file'></td>"// Echo the image inside a <td> element
            
    // End of the while loop
        
    closedir($dh); // Close the directory connection
        
    // End of the if statement
    // End of the if statement
    ?>
    </tr>
    </table>
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph


  •  

    Posting Permissions

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