I'm doing something stupid but I do not know which one.
I'm basically trying to create some classes in css, but it's not working as expected
td.ok {
height:26px;
padding-left:4px;
padding-right:2px;
font-family:Verdana, Geneva, sans-serif;
font-size:12px;
white-space:nowrap;
border-bottom:solid 1px #E1E1E1;
background-color: #A2CD5A;
color: black;
}
tr.mostok:hover{
background-color: green;
color:black;
}
In theory the class 'tr.mostok' should activate the hover in the entire row of the table when I hover over it, however, it is only painting a single table cell. Remember that if I throw the name 'mostok' and I leave only:
tr:hover{
background-color: green;
color:black;
}
The Hover is active on the entire line normally.
Below is the function that should create the table.
for($n = 0; $n < $j; $n++){
echo '<tr class="mostok">';
for($o = 0; $o < (($k*2) + 1); $o++){
echo '<td class="ok">' .$mat[$n][$o]. '</td>';
}
echo '</tr>';
}
EDIT 1: I have another CSS file that helps in formatting the table, is it generating some conflict?
table {
border-collapse: collapse;
float: center;
}
th {
background-color:#CCC;
font-size: 12px;
color:#484848;
padding-left:4px;
padding-right:4px;
border-bottom:solid 1px #CCC;
height:26px;
padding-right:5px;
border-collapse: collapse;
border:1px solid #F3F3F3;
font-family:Verdana, Geneva, sans-serif;
}
td {
text-align: right;
}
caption {
font-family: Verdana;
font-size: smaller;
}
EDIT 2 : To create the entire table, I do it this way:
<table align="center">
<?php
$texto_topo = "<html><body>Origem: $origem</body></html>";
echo'<caption align="top">'.$texto_topo.'</caption>';
for($e = 0; $e < $k; $e++){
$f = $e+1;
$legenda = "<html><body>Servidor $f: $ult_nome[$e]</body></html>";
echo'<caption align="top">'.$legenda.'</caption>';
}
echo '<tr>';
echo '<th>' .Papel. '</th>';
for($h = 1; $h < ($k + 1); $h++){
$nome = "Hora Server";
$hora_top = "$nome $h";
echo '<th>' .$hora_top. '</th>';
}
for($m = 0; $m < $k; $m++){
$number_col = $m+1;
$nom_top = "Server";
$cab = "$Coluna $nom_top $number_col";
echo '<th>' .$cab. '</th>';
}
echo '</tr>';
for($n = 0; $n < $j; $n++){
echo '<tr class="mostok">';
for($o = 0; $o < (($k*2) + 1); $o++){
echo '<td class="ok">' .$mat[$n][$o]. '</td>';
}
echo '</tr>';
}
?>
</table>
Above is how the table is made, I did not put the php that assembles the table because it makes no difference to the stylization. All the css that "embellishes" the table I already posted above, I left exactly as it is on my computer, ie with all the suggestions that have been given me here, and the way it is, the hover does not work: >