473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

2 column listings

Hi all,

I have this piece of code in my page:

<table width="100%" border="0" cellspacing="0" cellpadding="10">
<?php do { ?>
<tr>
<td width="100">
<div align="center">
<a href="productdetail.php?id=<?php echo $row_Recordset1['id']; ?>">
<img src="/user_thumbs/<?php echo $row_Recordset1['file']; ?>"
border="0"></a>
</div>
</td>
<td><?php echo $row_Recordset1['title']; ?>
</td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>

What I'd like to be able to do is display this in 2 columns but I can't
get my head round what I need to do.

Any help would be gratefully received.

A
Jul 17 '05 #1
4 1732
Andy Jacobs wrote:

<snip>
What I'd like to be able to do is display this in 2 columns but I can't
get my head round what I need to do.
Hi Andy,

I don't get it.
You have two columns in your table!
2 TD's.
What is it excactly you want to accomplish?

Regards,
Erwin Moller

Any help would be gratefully received.

A


Jul 17 '05 #2
Andy Jacobs wrote:
What I'd like to be able to do is display this in 2 columns but I can't
get my head round what I need to do.

Any help would be gratefully received.

A


Something like this?

<table width="100%" border="0" cellspacing="0" cellpadding="10">
<?php
do {
$tr = !(++$row % 2);
if (!$tr) print "<tr>";
?>
<td width="100">
<div align="center">
<a href="productdetail.php?id=<?php echo $row_Recordset1['id']; ?>">
<img src="/user_thumbs/<?php echo $row_Recordset1['file']; ?>"
border="0"></a>
</div>
</td>
<td><?php echo $row_Recordset1['title']; ?>
</td>
<?php if ($tr) print "</tr>";
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
if (!$tr) print "</tr>";
?>
</table>
JW
Jul 17 '05 #3
In article <41***********************@news.xs4all.nl>,
Erwin Moller
<si******************************************@spam yourself.com> wrote:
Andy Jacobs wrote:

<snip>
What I'd like to be able to do is display this in 2 columns but I can't
get my head round what I need to do.


Hi Andy,

I don't get it.
You have two columns in your table!
2 TD's.
What is it excactly you want to accomplish?


Sorry, my fault. I actually meant 4 columns. At the moment, col 1 is a
thumbnail, col 2 is a title. I want col 3 to be the second thumbnail
and col 4 to be the 2nd description - and so on.

Looks like it may have been answered already though.

Andy
Jul 17 '05 #4
In article <41***********************@maya.euronet.nl>,
Janwillem Borleffs <jw@jwscripts.com> wrote:
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<?php
do {
$tr = !(++$row % 2);
if (!$tr) print "<tr>";
?>
<td width="100">
<div align="center">
<a href="productdetail.php?id=<?php echo $row_Recordset1['id']; ?>">
<img src="/user_thumbs/<?php echo $row_Recordset1['file']; ?>"
border="0"></a>
</div>
</td>
<td><?php echo $row_Recordset1['title']; ?>
</td>
<?php if ($tr) print "</tr>";
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
if (!$tr) print "</tr>";
?>
</table>


Yup, that does exactly what I need.

Cheers

A
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Wm | last post by:
I'm trying to get a handle on the best way to handle setting up my listings so that I display groups of about 25 records per page. I currently have a page that returns over 1,000 names/addresses,...
11
by: ben lessani | last post by:
Hi guys, I've been searching all day for a method on how to integrate the listings off ebaY onto my website, but I have had no joy whatsoever. I want to be able to open a listing based on the...
4
by: Erik Lechak | last post by:
Hello all, Is there anyone out there that has written anything in python to download tv listings (no XML)? All the tv listing stuff that I can find is way too complex for my taste (includes...
2
by: Sam Churchill | last post by:
I have need to show a list of areas indented hierarchically on an ASP web page like the following example. The World Europe United Kingdom England Wales Scotland Northern Ireland
3
by: Daniel M | last post by:
I'm building a medium-scale data-entry web application, which involves creating data entry forms, record listings and detail screens for lots of database tables. Rather than designing a series...
5
by: Robert Latest | last post by:
Hello, if HTML authoring includes HTML autogeneration, this request is on-topic. Otherwise please forgive me and point me in the right direction. I'd like to make a bunch of dirs full of files...
4
by: Name Withheld | last post by:
OK i know this is a 101 question but... ASP.NET/VB.NET ListingItems() as string I need a nested array of Listings().ListingItems() so i can read a text file and split each line and insert...
7
by: samatair | last post by:
I need to change an existing listings page with pagination. Each page shows 10 listings and they are ordered by the date they are added to the site. Now recently added listings show up in the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.