Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/06/2004, 05:36
Avatar de PatomaS
PatomaS
Colaborador
 
Fecha de Ingreso: marzo-2004
Ubicación: En alguna otra parte
Mensajes: 4.656
Antigüedad: 20 años, 1 mes
Puntos: 63
Ajustar la altura de una tabla al 100%

Hola

Aquí te paso una hojita en xhtml 1.1, perfectamente funcional, válida y probadita.

El efecto funciona bien en:
- firefox 0.8
- netscape 7.0
- explorer 6.0 sp1
- phoenix 0.7

Falla en:
- Opera 7.23

Si alguien encuentra el motivo, ya me dirá.

Bueno, aquí va el código:

Código:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es">
<head>
<script type="text/javascript">
<!--
	function redimensionar() {
		if (navigator.appName != "Microsoft Internet Explorer") {
			var altura = (window.innerHeight - 18);
			document.getElementById('capita').style.height = altura+'px';
		} else {
			document.getElementById('capita').style.height = "100%";
		}
	}
//-->
</script>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body onload="javascript:redimensionar()">
<div style="width: 100%; height: 100px;" id="capita">
	<table border="1" cellspacing="0" cellpadding="0" style="height: 100%; width: 100%;">
		<tr>
			<td style="height: 40px; background: #000000;">&nbsp;</td>
		</tr>
		<tr>
			<td style="height: 30px; background: #FFFFFF;">&nbsp;</td>
		</tr>
		<tr>
			<td style="background: #CCCCCC;">&nbsp;</td>
		</tr>
		<tr>
			<td style="height: 20px; background: #000000;">&nbsp;</td>
		</tr>
	</table>
</div>
</body>
</html>
Felicidad
__________________
¡ hey, hou, hou, hey !