Web Development

General discussion


Populating a table with multiple images

By neil30076 ·
I need to build a dynamic table that will display 4 columns x any number of rows, where each row x column combination contains an image a brief text. The user will see 4 images per row, and 4 sets of text, repeated for however many rows are required to show all the records.
Image urls and text come from a database where each database record is a image/text combination. Can someone give me a clue how to start this .

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

is this homework?

by mac1ne In reply to Populating a table with m ...

umm....this is pretty basic programming, you should google "tutorial" and whatever language you hope to use.


table open
for each record returned from the database query

if i == 0 or i/4 leaves no remainder
tr open
i_have_a_row_open = true
end if

td open
print the record image
print the record text
td close

if (i != 0 and i/4 leaves no remainder) OR i_have_a_row_open == true
tr close
i_have_a_row_open = false
end if

table close

Collapse -


by jalleyne In reply to Populating a table with m ...

depends on the language u plan to use or are already using, i did this in php recently and this is how i accomplihed it. there may be other ways but it worked fine. im assuming u have the knowledge of the language and the database scripting.

1.design the table with 1 row and image place holders and room for watever else u need to add in there. i.e text.

2. put the table cell into a "while" loop statement, making sure the <table> and </table> tags are outside the loops (open tag before loop and close table tag after loop). so that it repeats as many times as u have entries from your db and that should rewrite the table code for each entry.

check google for more details if needed. this is pretty simple programming.. hope it helps

Collapse -

Table of images

by ppoxon In reply to basics

Check out Ifanview. It will create a table of images and you can add information and or labels to the images. Check out also programs that create Thumnails

Related Discussions

Related Forums