/    Sign up×
Community /Pin to ProfileBookmark

tabel formating

hello dear all..
and thanks for all the gr8 help i get from this website…
i have result frome the select query and i want to display it in this format

item1 item2 item 3
item4 item5 item6
etc
on tabel where i can manage the cells background color to make it user firendy…..

how can i do that where normal php code on dreamweaver shos it like this
item1
item2
item3
etc
and thanks

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@zatomasauthorNov 04.2007 — is it undoable......

any replay may be usful
Copy linkTweet thisAlerts:
@NogDogNov 04.2007 — This is often done with the [url=http://www.php.net/manual/en/language.operators.arithmetic.php]modulus operator[/url] ("%").
[code=php]
<table>
<tr>
<?php
$counter = 1;
while($row = mysql_fetch_assoc($result))
{
echo "<td>{$row['some_value']}</td>";
if($counter % 3 == 0 and $counter < mysql_num_rows($result))
{
echo "</tr>n<tr>";
}
$counter++;
}
?>
</tr>
</table>
[/code]
×

Success!

Help @zatomas spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...