Page 1 of 1

little Formatting Issue in FIREFOX in SHOW/Hide Column

Posted: Fri Jan 12, 2007 7:47 am
by eshban
Hello,

I have just write a small code which hide the SECOND COLUMN OF CELL when the user clicks on the link. It works well in IE, but the formatting of Second Column disturb in FIREFOX.

If someone fix it, then it will help me very much.

To hide the second column, just refresh the code.

Here is my code:

Code: Select all

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript">

	function hide(){
		document.getElementById('second').style.display = 'none';
	}


   function showcolumn(){
      // Toggle visibility between none and inline
        document.getElementById('second').style.display = 'inline';
  }  
</script> 
</head>

<body onload=hide()>
	<table border="1" width="80%" align="center">
	  <tr>
		<td onclick="showcolumn()"><a href="#">Click me</a> </td>
		<td id="second">Second Row</td>
		<td id="third">Third Row</td>
	  </tr>
	</table>
	
</body>
</html>


Posted: Fri Jan 12, 2007 9:08 am
by feyd
You want table-cell, not inline.

Please don't breakup your code into separate blocks if they're the same file.