Hola a todos. Estaba experimentando un poco con JavaScript y tablas HTML, e hice una tabla con un encabezado y luego, a las filas que hay debajo de éste, les agregué una llamada a una función JavaScript para que cuando se pase con el mouse sobre ellas se cambien de color los bordes izquierdo, derecho y el de abajo; y al salir de la fila vuelva a la normalidad. El problema es que sólo funciona bien en Firefox y no en Chrome ni en Explorer (en este caso pienso que es porque le aplico las funciones al tag <tr>). Los códigos son los siguientes:
HTML (tabla.htm):
Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <table width="400" cellspacing="0" cellpadding="2" border="1" bordercolor="#CCCCCC" frame="box" rules="rows"> <tr height="26" align="center" valign="middle" bgcolor="#CCCCCC" style="border-bottom:#CCCCCC"> <tr height="28" align="center" valign="middle" onmouseover="subrayar_over(this)" onmouseout="subrayar_out(this)"> <tr height="28" align="center" valign="middle" onmouseover="subrayar_over(this)" onmouseout="subrayar_out(this)"> <tr height="28" align="center" valign="middle" onmouseover="subrayar_over(this)" onmouseout="subrayar_out(this)"> <tr height="28" align="center" valign="middle" onmouseover="subrayar_over(this)" onmouseout="subrayar_out(this)"> <tr height="28" align="center" valign="middle" onmouseover="subrayar_over(this)" onmouseout="subrayar_out(this)"> <tr height="28" align="center" valign="middle" onmouseover="subrayar_over(this)" onmouseout="subrayar_out(this)">
JavaScript (subrayar.js):
Código Javascript
:
Ver originalfunction subrayar_over(fila){
fila.style.borderBottom="solid 1px #09F";
fila.style.borderRight="solid 1px #09F";
fila.style.borderLeft="solid 1px #09F";
}
function subrayar_out(fila){
fila.style.borderBottom="solid 1px #CCC";
fila.style.borderRight="solid 1px #CCC";
fila.style.borderLeft="solid 1px #CCC";
}
Bueno si alguien me puede dar una mano se lo agradezco. Saludos.