Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts

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

    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
    Code:
    <!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>
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    It seems to work for me (FF, OS X)... what are you trying to have it display as?

  • #3
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    doesnt work in IE

    will something else work?
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #4
    New to the CF scene
    Join Date
    Apr 2005
    Location
    Norway, Haugesund
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Only alternate I know of is to put &nbsp; in every empty cell.

  • #5
    Regular Coder
    Join Date
    Nov 2004
    Location
    The Netherlands
    Posts
    551
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you know this? <img src="blabla" alt="blabla" />
    Well... <div /> and <td />
    CATdude about IE6: "All your box-model are belong to us"

  • #6
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    ya, i actually ended up throwing in a 1px div to keep the cell visible :P
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •