У меня есть код, который строит таблицу с некоторыми данными, и я хочу различать строки по цвету с помощью CSS и PHP.Линии с цветовыми диапазонами
Мой код:
foreach ($resultSql as $line) {
$_atribute = $this->recoverAtribute($line'attribute_id']);
$_optionText = $this->recoverOptionid($_atribute, $line['option_id']);
$desc=$line['ds_cont'] ;
$order = array("\n");
$replace = '<br />';
$newstr = str_replace($order, $replace, $desc);
if($line['ds_cont']='dest'){
echo $line['ds_cont']='';
}
if (isset($line['ds_cont']) && $line['ds_conteudo'] != '') {
echo '<tr >
<td class="table-carac-title" style="padding-left: 45px !important;padding-right: 45px !important; "> ' . ucwords(strtolower($_optionText)) . '</td>
<td class="table-carac-desc" style="padding-left: 45px !important;padding-right: 45px !important;"> ' . $newstr. '</td>
</tr>';
} else {
echo '<tr >
<td class="table-carac-title" style="padding-left: 45px !important;padding-right: 45px !important;">' . $_atribute->getFrontend_label() . '</td>
<td class="table-carac-desc" style="padding-left: 45px !important;padding-right: 45px !important;"> ' . $_optionText . '</td>
</tr>';
}
$count = $count + 1;
}