|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Alternating Row Colors.
I set up this news system, and I have displayed it in a "Latest News Headlines" type of table on my site. I would liek alternate row colors. Also, in this table on my site, i have displayed some headlines which I would liek to have linked to my article. How would I do so?
|
|
#2
|
|||
|
|||
|
Alternate Row Color
=================== Hints: ---------------- $p=0; for ($j=0;$j<TotalCount;$j++) { // display row $MyColor=($p==0) ? "#FFFFFF":"#F0F0F0"; $p=($p==1) ? 0:1; } |
|
#3
|
|||
|
|||
|
<?php
$data = file('news.txt'); $data = array_reverse($data); foreach($data as $element) { $element = trim($element); $pieces = explode("|", $element); echo "<b>" . $pieces[3] . "</b><BR>" . "<i>Posted by " . $pieces[1] . " on " . $pieces[0] . "</i>\n"; } ?> that is my script. I still dont understand where to place this. additioanlly, i would like to know how to view a single news article. like, i add a news article and it is viewed as a list of articles. According to the tutorial. But how do I view only one article? |
|
#4
|
||||
|
||||
|
here's a script I whipped up for you... it's an example for listing mail items in a webmail client... this is just an example (but it does work for me so..
) It's a little big so... yeah.. but this will alternate the row colors..PHP Code:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > Alternating Row Colors. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|