As far as i know, an ID and a class are not the same.
You can not say "ID of a class" in this meaning.
Either it is an ID id="someId"
or its a CLASS class="someClass"
If the td
has a unique format or something, try making the id unique:
https://developer.mozilla.org/nl/docs/Web/CSS/ID_selectors
for ($j = 1; $j <= 9; ++$j)
{
if ($j % 2 == 0)
{
echo '<td class="pair" id="DiagP_' . $j . '">' . $j .'</td>';
}
}
If the td
doesnt have to be unique, use a class:
https://developer.mozilla.org/nl/docs/Web/CSS/Class_selectors
for ($j = 1; $j <= 9; ++$j)
{
if ($j % 2 == 0)
{
echo '<td class="pair" class="DiagP">' . $j .'</td>';
}
}
Further reading about id versus class
https://css-tricks.com/the-difference-between-id-and-class/