Hi bakunin,
As davido points out above this is more a HTML question than perl but I'll bite anyway and try and help. You'll be wanting something not entirely unlike below yes?

Image 1 Image 2 Image 3
Caption 1 Caption 2 Caption 3

Well to code a table like that you need HTML something like:

<table width="100%" border="2" cellspacing="1" cellpadding="4"> <tr><td align="center"> <b>Image 1</b> </td><td align="center"> <b>Image 2</b> </td><td align="center"> <b>Image 3</b> </td></tr> <tr><td align="center"> Caption 1 </td><td align="center"> Caption 2 </td><td align="center"> Caption 3 </td></tr> </table>

Obviously you can change the content of the tags to meet your requirements. Achieving this in perl is as always a TMTOWTDI scenario, but you probably want to be looking at CGI.pm. A quick heads up though, read the dox carefully as the tr tag using this system will give you results you didn't expect otherwise (hint: Tr).

How you incorporate a loop to go through images placing them in table cells then matching the caption text is another topic you'll need to think about but hopefully the above will get you started down the road to success.

Good luck and happy coding.


In reply to Re: image captions in a gallery by barrd
in thread image captions in a gallery by bakunin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.