...

View Full Version : table { empty-cells: show } doesn't seem to work



canadianjameson
05-27-2005, 11:17 PM
hey, quick and easy question. i have a CSS problem whereby Table { empty-cells: show } won't seem to work. any ideas?

here's my code. I bolded the affected parts


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Hairy Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script type="text/javascript">
function showLinks(n){
var el=document.getElementById(n);
var p=el.parentNode;
for(var i=0;i<p.childNodes.length;i++){//check all of n's siblings (n's parent's childen)
if(p.childNodes[i].style && p.childNodes[i].style.display=='block'){//find who is displaying
p.childNodes[i].style.display='none';
if(p.childNodes[i]==el) return;//remove this line to remove toggling action
break;
}
}
el.style.display='block'
}
</script>

<style type="text/css">
table {
empty-cells: show }
td {
text-align: center }
</style>
</head>

<body>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width=25%><a href="#" onClick="showLinks('class1');return false">Link 1</a></td>
<td width=25%><a href="#" onClick="showLinks('class2');return false">Link 2</a></td>
<td width=25%>Link 3</td>
<td width=25%>Link 4</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2">
<div id="class1" style="display: none">Link 1.1 | Link 1.2</div>
<div id="class2" style="display: none">Link 2.1 | Link 2.2</div>
<div id="class3" style="display: none"></div>
<div id="class4" style="display: none"></div>
</td> <td>&nbsp;</td>
</tr>
</table>
</body>
</html>

rmedek
05-28-2005, 05:48 AM
It seems to work for me (FF, OS X)... what are you trying to have it display as?

canadianjameson
05-28-2005, 07:59 AM
doesnt work in IE

will something else work?

KaZaK
05-30-2005, 11:42 AM
Only alternate I know of is to put &nbsp; in every empty cell.

mrruben5
05-30-2005, 12:03 PM
you know this? <img src="blabla" alt="blabla" />
Well... <div /> and <td /> :p

canadianjameson
05-30-2005, 03:24 PM
ya, i actually ended up throwing in a 1px div to keep the cell visible :P



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum