http://www.perlmonks.org?node_id=300589


in reply to image captions in a gallery

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.