2010/1/23 3:42
demian
Quite a regular
Posts: 225
Since: 2008/4/29
echo ""; echo "Bil"; echo "Name"; echo "Title"; echo "Unit"; echo ""; while($row = mysql_fetch_array($result)) { $id=$row['id']; echo ""; echo ""; echo $bil++; echo ""; echo "" . $row['name'] . ""; echo "" . $row['title'] . " " . $row['gred'] . "" . $row['No'] . ""; echo "" . $row['unit'] . ""; echo ""; } echo "";echo "";
2010/1/23 5:10
ghia
Community Support Member
Posts: 4953
Since: 2008/7/3 1
$class = ($i % 2 == 0) ? 'even' : 'odd'; echo "{$class}'> $i is a counter inside the loop.Better is to use a template. An example with odd, even is in eg the templates for the blocks of the system module. 3 Re: help with odd, even table styling 2010/1/23 12:22 demian Quite a regular Posts: 225 Since: 2008/4/29 thats the plan using template...this is a temp solutionthanks ghia...it almost work but it only use the even class for all rowi got another solution from another forum i use this $int = 0; while (/* ... */) { echo ', ++$int & 1 ? 'even' : 'odd', '">'; // ... } and it works 4 Re: help with odd, even table styling 2010/1/23 13:29 ghia Community Support Member Posts: 4953 Since: 2008/7/3 1 (Is odd and even not reversed on that one?) 5 Re: help with odd, even table styling 2010/1/23 15:07 demian Quite a regular Posts: 225 Since: 2008/4/29 ..reversed ? noit works exactly how i wanted..actually i got the answer from a php forum Login Username Password Remember me Reset Search Advanced Search Recent Posts Re: Solution for Not able to login anymore after upgrading to XOOPS 2.5.11 and 2.5.12 Beta 8 10/1 10:09 Mamba Re: Solution for Not able to login anymore after upgrading to XOOPS 2.5.11 and 2.5.12 Beta 8 9/30 21:52 Mamba Solution for Not able to login anymore after upgrading to XOOPS 2.5.11 and 2.5.12 Beta 8 9/30 9:16 goffy Re: XOOPS 2.5.12 Beta-8 available for Testing 9/13 4:09 Mamba Re: XOOPS 2.5.12 Beta-8 available for Testing 9/11 18:14 Mage XOOPS 2.5.12 Beta-8 available for Testing 9/11 7:40 Mamba Re: XOOPS 2.5 Theme - Guanga by 8pm!!! 9/3 20:44 wishcraft Re: XOOPS 2.5 Theme - Guanga by 8pm!!! 8/27 7:41 Mamba Re: XOOPS 2.5 Theme - Guanga by 8pm!!! 8/12 0:01 wishcraft Re: XOOPS 2.5 Theme - Guanga by 8pm!!! 8/11 13:29 luciorota Who's Online 307 user(s) are online (177 user(s) are browsing Support Forums) Members: 0 Guests: 307 more... Donat-O-Meter Stats Goal: $15.00 Due Date: Oct 31 Gross Amount: $0.00 Net Balance: $0.00 Left to go: $15.00 Latest GitHub Commits {{ record.sha.slice(0, 7) }} - {{ record.commit.message | truncate }} {{ record.commit.author.name }} {{ record.commit.author.date | formatDate }}
2010/1/23 12:22
$int = 0; while (/* ... */) { echo ', ++$int & 1 ? 'even' : 'odd', '">'; // ... } and it works 4 Re: help with odd, even table styling 2010/1/23 13:29 ghia Community Support Member Posts: 4953 Since: 2008/7/3 1 (Is odd and even not reversed on that one?) 5 Re: help with odd, even table styling 2010/1/23 15:07 demian Quite a regular Posts: 225 Since: 2008/4/29 ..reversed ? noit works exactly how i wanted..actually i got the answer from a php forum Login Username Password Remember me Reset Search Advanced Search Recent Posts Re: Solution for Not able to login anymore after upgrading to XOOPS 2.5.11 and 2.5.12 Beta 8 10/1 10:09 Mamba Re: Solution for Not able to login anymore after upgrading to XOOPS 2.5.11 and 2.5.12 Beta 8 9/30 21:52 Mamba Solution for Not able to login anymore after upgrading to XOOPS 2.5.11 and 2.5.12 Beta 8 9/30 9:16 goffy Re: XOOPS 2.5.12 Beta-8 available for Testing 9/13 4:09 Mamba Re: XOOPS 2.5.12 Beta-8 available for Testing 9/11 18:14 Mage XOOPS 2.5.12 Beta-8 available for Testing 9/11 7:40 Mamba Re: XOOPS 2.5 Theme - Guanga by 8pm!!! 9/3 20:44 wishcraft Re: XOOPS 2.5 Theme - Guanga by 8pm!!! 8/27 7:41 Mamba Re: XOOPS 2.5 Theme - Guanga by 8pm!!! 8/12 0:01 wishcraft Re: XOOPS 2.5 Theme - Guanga by 8pm!!! 8/11 13:29 luciorota Who's Online 307 user(s) are online (177 user(s) are browsing Support Forums) Members: 0 Guests: 307 more... Donat-O-Meter Stats Goal: $15.00 Due Date: Oct 31 Gross Amount: $0.00 Net Balance: $0.00 Left to go: $15.00 Latest GitHub Commits {{ record.sha.slice(0, 7) }} - {{ record.commit.message | truncate }} {{ record.commit.author.name }} {{ record.commit.author.date | formatDate }}
2010/1/23 13:29
2010/1/23 15:07
Advanced Search
307 user(s) are online (177 user(s) are browsing Support Forums)
Members: 0
Guests: 307