Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Repeat region : CSS DIV

Guest
Feb 20, 2008 Feb 20, 2008
I have just completed a tutorial on basic database driven html (Cafe Townsend). This tutorial uses html tables in order to display the recordsets, and a repeat region that creates new table rows for each record in the database table. I am wondering is it possible to recreate this without the use of html tables, but instead using css and DIV's? If so can anyone point me in the direction of a tutorial or advise on how to do it.

Thanks

Barry.
TOPICS
Server side applications
317
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 20, 2008 Feb 20, 2008
LATEST
Yes it is possible, however as I'm discovering the Recordset Paging
server behavior still locks you into the maximum number of records shown
per page. Therefore, if you are hoping to have floated DIVs fill up a
given container you have no choice but to select ALL for maximum records
shown. See my post from yesterday Question about Repeat Region.

Anyway, making a DIV a repeating region is as easy as a table. Create
your DIV, insert your dynamic content, and apply a Repeat Region s.b.
Below is my code, in which I have a thumbnail image and a caption all
inside a repeated DIV:

> <?php do { ?>
> <div id="imgcont"><a href="product_detail.php?prod_id=<?php
> echo $row_chooseProducts['prod_id']; ?>"><img
> src="images/product_imgs/thmb/<?php echo $row_chooseProducts['image'];
> ?>"
> alt= <?php echo $row_chooseProducts['mod_num']; ?> /></a><br />
> <p class="imgcapt"><?php echo
> $row_chooseProducts['mod_num']; ?></p>
> </div>
> <?php } while ($row_chooseProducts =
> mysql_fetch_assoc($chooseProducts)); ?>

The only difference is that you will want to have a container DIV around
your repeated DIV's so they can be contained in one place on your page.
The repeated DIVs need to be Floated left unless you just want them
stacked one atop the other. Set margins, border, background-color, etc.
for your repeated DIVs in your stylesheet.

Hope that helps.

Brett



Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines