Jump to content

Wal-Wal-2

New Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Wal-Wal-2

  • Rank
    Newbie
  1. I have an array of data in which I want to display in a table with the first row of data to not be formatted. In the second row of data, I want it formatted with the CSS class of "success". When I run this code, I do not get any formatting of any rows in the table. I have tried various different options without success. Any help would be greatly appreciated. <?php $counter = 0; while($row = mysql_fetch_array($query)) { if($counter % 2 == 0) { //output data from each row of data with no class of "success" echo "<tr class='text-left'>"; if (empty($row[endDate])) { echo "<td>".$row[startDate]."</td>"; /* only one date */ } else { echo "<td>".$row[startDate].'-'.$row[endDate]."</td>"; /*date range */ } echo "<td>".$row[rideName]."</td>"; echo "<td>".$row[rideDesc]."</td>"; echo "<td>".$row[location]."</td>"; echo "<td><a href='".$row[link]."'>".$row[source]."</a></th>"; echo "</tr>"; $counter++; } else { //output data from each row echo "<tr class='text-left success'>"; if (empty($row[endDate])) { echo "<td>".$row[startDate]."</td>"; } else { echo "<td>".$row[startDate].'-'.$row[endDate]."</td>"; } echo "<td>".$row[rideName]."</td>"; echo "<td>".$row[rideDesc]."</td>"; echo "<td>".$row[location]."</td>"; echo "<td><a href='".$row[link]."'>".$row[source]."</a></th>"; echo "</tr>"; $counter++; } /* end if else */ } /* end while */ ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.