There is two ways to display the sql data in Data Tables ( jQuery ), one is fetch the data with loop, and the other is to use sAjaxsource . if i`m using the first option,i can change the color of each tr . for example
<th>id</th>
<th>Customer Number</th>
<th>WCODE</th>
</tr>
</thead>
<tbody>
<?php
while ($row = mysql_fetch_array($result)) {
?>
<tr style="background-color:<?=$row['COLOR']?>;border:1px solid;" >
<td ><?=$row['id']?></td>
as you can see, $row['COLOR'] is the color of each row.
By using some features i need to use the second option, sAjaxsource.
so everything is ok, and the data is on the screen. but how i can get to each row and set the background color as i did in the first option? because in the code the tbody is empty and i cant control each tr. there is no tr.
any ideas? thanks.
<th>id</th>
<th>Customer Number</th>
<th>WCODE</th>
</tr>
</thead>
<tbody>
<?php
while ($row = mysql_fetch_array($result)) {
?>
<tr style="background-color:<?=$row['COLOR']?>;border:1px solid;" >
<td ><?=$row['id']?></td>
as you can see, $row['COLOR'] is the color of each row.
By using some features i need to use the second option, sAjaxsource.
so everything is ok, and the data is on the screen. but how i can get to each row and set the background color as i did in the first option? because in the code the tbody is empty and i cant control each tr. there is no tr.
any ideas? thanks.