Reply
2 columns in a row
Old 04-29-2004, 12:55 PM 2 columns in a row
Junior Talker

Posts: 2
Is there a way to get 2 columns in 1 row, like this:

Record 1 | Record 2
-----------|----------
Record 3 | Record 4
-----------|----------
Record 5 | Record 6

thanks
marky7890 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 04-29-2004, 02:01 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
PHP and Unicode with UTF-8
Posts: 3,111
Location: Toronto, Ontario
I'm not sure what you mean. You mean you want to insert records into a table, but put them in rows of 2? You can use a count and count up, then use the modulus operator to see when to create a new row.

PHP Code:
<table>
<tr>
<?php
$counter 
0;
while(
$row mysql_fetch_array($myresult))
{
    
$counter++;
    if(
$counter == 0// every 3rd item, make a new row
        
echo "</tr><tr>";
    echo 
"<td>$mydata</td>";
}
?>
</tr>
</table>
Christopher is offline
Reply With Quote
View Public Profile Visit Christopher's homepage!
 
Reply     « Reply to 2 columns in a row
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11826 seconds with 12 queries