Código HTML:
<html> <head> <title></title> <script> function algo(bot) { do bot = bot.parentNode while (bot.tagName != 'TR') for(i=0; ele = bot.getElementsByTagName('input')[i]; i++) ele.readOnly = false; } </script> </head> <body> <table border="1"> <tr> <td>id</td> <td>nº Matricula</td> <td>Alumno</td> <td>sol 1</td> <td>sol 2</td> <td>ctrl 1</td> <td>ctrl 2</td> <td>ctrl 3</td> <td>ctrl 4</td> <td>Examen</td> <td>Final</td> </tr> <? foreach ($datos as $us) {?> <tr> <td align="center"><?=$us['id'];?></td> <td align="center"><?=$us['n_matricula'];?></td> <td align="center"><?=$us['alumno_nom'];?> <?$us['alumno_nom'];?></td> <td align="center"><input type="text" size="1" readonly="readonly" value="<?=$us['sol1'];?>"</td> <td align="center"><input type="text" size="1" readonly="readonly" value="<?=$us['sol2'];?>"</td> <td align="center"><input type="text" size="1" readonly="readonly" value="<?=$us['ctrl1'];?>"</td> <td align="center"><input type="text" size="1" readonly="readonly" value="<?=$us['ctrl2'];?>"</td> <td align="center"><input type="text" size="1" readonly="readonly" value="<?=$us['ctrl3'];?>"</td> <td align="center"><input type="text" size="1" readonly="readonly" value="<?=$us['ctrl4'];?>"</td> <td align="center"><input type="text" size="1" readonly="readonly" value="<?=$us['examen'];?>"</td> <td align="center"><?=promedio($us['sol1'], $us['sol2'], $us['ctrl1'], $us['ctrl2'], $us['ctrl3'], $us['ctrl4'], $us['examen']);?></td> <td align="center"><input type="button" name="Editar" value="Editar" onclick="habilitar()"></td> </tr> <? } ?> </table> </body> </html>