<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Collapsing Table Rows</title>
	<atom:link href="http://alexking.org/blog/2004/10/27/collapsing-table-rows/feed" rel="self" type="application/rss+xml" />
	<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows</link>
	<description>Alex King, Denver Web Developer</description>
	<lastBuildDate>Thu, 09 Feb 2012 18:02:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Adam the Chidge</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-65217</link>
		<dc:creator>Adam the Chidge</dc:creator>
		<pubDate>Thu, 30 Oct 2008 18:38:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-65217</guid>
		<description>Hello folks!

I found out how to fix this by manipulating the className property of the row in DHTML in conjunction with the display:none and display:table-row css properties.

e.g. 

 if (rows[i].className==&quot;show&quot;)
  rows[i].className = &quot;hide&quot;;

And the CSS to accompany is:

table tr .show {display:table-row;}
table tr .hide {display:none;}

DO NOT USE:

row.style.visibility or row.style.display as for some reason in IE 7, it just doesn&#039;t return the correct styles or allow you to manipulate them, hence I used the class approach.

Good luck.</description>
		<content:encoded><![CDATA[<p>Hello folks!</p>
<p>I found out how to fix this by manipulating the className property of the row in DHTML in conjunction with the display:none and display:table-row css properties.</p>
<p>e.g. </p>
<p> if (rows[i].className==&#8221;show&#8221;)<br />
  rows[i].className = &#8220;hide&#8221;;</p>
<p>And the CSS to accompany is:</p>
<p>table tr .show {display:table-row;}<br />
table tr .hide {display:none;}</p>
<p>DO NOT USE:</p>
<p>row.style.visibility or row.style.display as for some reason in IE 7, it just doesn&#8217;t return the correct styles or allow you to manipulate them, hence I used the class approach.</p>
<p>Good luck.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-30321</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 04 Aug 2006 17:02:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-30321</guid>
		<description>That was already &lt;a href=&quot;http://alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-2887&quot;&gt;posted above&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>That was already <a href="http://alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-2887">posted above</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ngan</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-30320</link>
		<dc:creator>Ngan</dc:creator>
		<pubDate>Fri, 04 Aug 2006 16:59:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-30320</guid>
		<description>To hide the row, set display=&quot;none&quot;

To show the row, set display=&quot;&quot;</description>
		<content:encoded><![CDATA[<p>To hide the row, set display=&#8221;none&#8221;</p>
<p>To show the row, set display=&#8221;"</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sumthin Wicked</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-9425</link>
		<dc:creator>Sumthin Wicked</dc:creator>
		<pubDate>Wed, 23 Nov 2005 15:22:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-9425</guid>
		<description>
something to inspire you (incomplete code) try:

function IFE_GroupShowHide(groupID, show)
{
	var oCell = document.getElementById(groupID + &#039;_Grp&#039;);
	var rows = eval(oCell.getAttribute(&#039;EnableFields&#039;));
	
	if (rows)
	{
		for (var o in rows)
		{
			show ? IFE_Show(rows[o] + &#039;_Row&#039;) : IFE_Hide(rows[o] + &#039;_Row&#039;);
			oCell.rowSpan += (show ? 1 : -1);
		}
	}			
}

in combination with:

&lt;table&gt;
&lt;tr bgcolor=#074F00&gt;
	&lt;td id=&#039;MasterRow_Grp&#039; rowspan=3 valign=top width=100 EnableFields=&quot;[&#039;Row1_Row&#039;,&#039;Row2_Row&#039;]&quot;&gt;&lt;h4&gt;Group name&lt;/h4&gt;&lt;/td&gt;
	&lt;td valign=top align=left&gt;Hide&lt;/td&gt;
	&lt;td valign=top align=left&gt;&lt;button value=&#039;Hide Them&#039; onClick=&quot;IFE_GroupShowHide(&#039;MasterRow&#039;, false);&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr id=&#039;Row1_Row&#039; bgcolor=#074F00&gt;
	&lt;td valign=top align=left&gt;Key&lt;/td&gt;
	&lt;td valign=top align=left&gt;&lt;input value=&#039;Value&#039;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr id=&#039;Row2_Row&#039; bgcolor=#074F00&gt;
	&lt;td valign=top align=left&gt;Key2&lt;/td&gt;
	&lt;td valign=top align=left&gt;&lt;input value=&#039;Value2&#039;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;



enjoy!, SumthinWicked</description>
		<content:encoded><![CDATA[<p>something to inspire you (incomplete code) try:</p>
<p>function IFE_GroupShowHide(groupID, show)<br />
{<br />
	var oCell = document.getElementById(groupID + &#8216;_Grp&#8217;);<br />
	var rows = eval(oCell.getAttribute(&#8216;EnableFields&#8217;));</p>
<p>	if (rows)<br />
	{<br />
		for (var o in rows)<br />
		{<br />
			show ? IFE_Show(rows[o] + &#8216;_Row&#8217;) : IFE_Hide(rows[o] + &#8216;_Row&#8217;);<br />
			oCell.rowSpan += (show ? 1 : -1);<br />
		}<br />
	}<br />
}</p>
<p>in combination with:</p>
<p>&lt;table&gt;<br />
&lt;tr bgcolor=#074F00&gt;<br />
	&lt;td id=&#8217;MasterRow_Grp&#8217; rowspan=3 valign=top width=100 EnableFields=&#8221;['Row1_Row','Row2_Row']&#8220;&gt;&lt;h4&gt;Group name&lt;/h4&gt;&lt;/td&gt;<br />
	&lt;td valign=top align=left&gt;Hide&lt;/td&gt;<br />
	&lt;td valign=top align=left&gt;&lt;button value=&#8217;Hide Them&#8217; onClick=&#8221;IFE_GroupShowHide(&#8216;MasterRow&#8217;, false);&#8221;&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr id=&#8217;Row1_Row&#8217; bgcolor=#074F00&gt;<br />
	&lt;td valign=top align=left&gt;Key&lt;/td&gt;<br />
	&lt;td valign=top align=left&gt;&lt;input value=&#8217;Value&#8217;&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr id=&#8217;Row2_Row&#8217; bgcolor=#074F00&gt;<br />
	&lt;td valign=top align=left&gt;Key2&lt;/td&gt;<br />
	&lt;td valign=top align=left&gt;&lt;input value=&#8217;Value2&#8242;&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;</p>
<p>enjoy!, SumthinWicked</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zayfod</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-8760</link>
		<dc:creator>Zayfod</dc:creator>
		<pubDate>Fri, 21 Oct 2005 14:19:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-8760</guid>
		<description>Recently I experienced the same problem but managed to solve it in a very portable way :)

I was trying to collapse only some of the rows of a table which had an always visible &quot;header&quot; row. Copying the value of its display property when trying to &quot;expand&quot; any of the other rows worked flawlessly in all cases.</description>
		<content:encoded><![CDATA[<p>Recently I experienced the same problem but managed to solve it in a very portable way <img src='http://alexking.org/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I was trying to collapse only some of the rows of a table which had an always visible &#8220;header&#8221; row. Copying the value of its display property when trying to &#8220;expand&#8221; any of the other rows worked flawlessly in all cases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: theKeyper</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-7371</link>
		<dc:creator>theKeyper</dc:creator>
		<pubDate>Mon, 15 Aug 2005 06:56:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-7371</guid>
		<description>I am having a similar problem. Setting display to &#039;&#039; works to show the row, however I have one cell going down the left hand side of the page with a Rowspan of 5. If I hide one of the rows, It removes it from the rowspan in FF and stuffs up the table layout. (IE works fine). Any Ideas?</description>
		<content:encoded><![CDATA[<p>I am having a similar problem. Setting display to &#8221; works to show the row, however I have one cell going down the left hand side of the page with a Rowspan of 5. If I hide one of the rows, It removes it from the rowspan in FF and stuffs up the table layout. (IE works fine). Any Ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-4948</link>
		<dc:creator>Gabriel</dc:creator>
		<pubDate>Wed, 13 Apr 2005 20:23:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-4948</guid>
		<description>Strangely this didn&#039;t work for me. So perhaps your fix is only a Windows fix as I&#039;m currently viewing Firefox on Linux. However, I did manage to fix it anyway much the same way that you get Firefox and IE both to display the pointer/hand cursor:

function showSearch() {
var searchSpan = document.getElementById(&#039;searchSpan&#039;);
var status = searchSpan.style.display;
    if (status == &#039;table-row&#039; &#124;&#124; status == &#039;block&#039;) {
    searchSpan.style.display= &#039;none&#039;;
    }
    else {
    searchSpan.style.display= &#039;block&#039;;
    searchSpan.style.display= &#039;table-row&#039;;
    }
}

The last bit is the weird part. Set to display:block and both IE and FF accept it. Set it to Table-row and IE ignores it (IE not supporting CSS2) and FF accepts it. Voila!</description>
		<content:encoded><![CDATA[<p>Strangely this didn&#8217;t work for me. So perhaps your fix is only a Windows fix as I&#8217;m currently viewing Firefox on Linux. However, I did manage to fix it anyway much the same way that you get Firefox and IE both to display the pointer/hand cursor:</p>
<p>function showSearch() {<br />
var searchSpan = document.getElementById(&#8216;searchSpan&#8217;);<br />
var status = searchSpan.style.display;<br />
    if (status == &#8216;table-row&#8217; || status == &#8216;block&#8217;) {<br />
    searchSpan.style.display= &#8216;none&#8217;;<br />
    }<br />
    else {<br />
    searchSpan.style.display= &#8216;block&#8217;;<br />
    searchSpan.style.display= &#8216;table-row&#8217;;<br />
    }<br />
}</p>
<p>The last bit is the weird part. Set to display:block and both IE and FF accept it. Set it to Table-row and IE ignores it (IE not supporting CSS2) and FF accepts it. Voila!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dodo</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-4391</link>
		<dc:creator>dodo</dc:creator>
		<pubDate>Thu, 03 Mar 2005 01:37:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-4391</guid>
		<description>aw alex, i emailed you first and then did a google search and found this post. silly me. so i guess my problem is solved :)</description>
		<content:encoded><![CDATA[<p>aw alex, i emailed you first and then did a google search and found this post. silly me. so i guess my problem is solved <img src='http://alexking.org/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-2890</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 28 Oct 2004 14:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-2890</guid>
		<description>Yep, that works beautifully. Thanks!</description>
		<content:encoded><![CDATA[<p>Yep, that works beautifully. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon B</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-2888</link>
		<dc:creator>Jon B</dc:creator>
		<pubDate>Thu, 28 Oct 2004 10:09:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-2888</guid>
		<description>Sebastian is right - well apparently - I think someone di a test about this - maybe shaun inman - check his site - it was this exact same problem if I remember correctly - basically it suggests that block isn&#039;t the opposite to none - infact there is a css &#039;display&#039; property for tables - however it isn&#039;t supported - so you you just want to remove teh style and let it default to whatever it would be normally.</description>
		<content:encoded><![CDATA[<p>Sebastian is right &#8211; well apparently &#8211; I think someone di a test about this &#8211; maybe shaun inman &#8211; check his site &#8211; it was this exact same problem if I remember correctly &#8211; basically it suggests that block isn&#8217;t the opposite to none &#8211; infact there is a css &#8216;display&#8217; property for tables &#8211; however it isn&#8217;t supported &#8211; so you you just want to remove teh style and let it default to whatever it would be normally.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-2887</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Thu, 28 Oct 2004 06:31:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-2887</guid>
		<description>Try to reset the display string to &quot;&quot; to reshow it:

Hide: &quot;none&quot;
Show: &quot;&quot;

This should work cross-browser.</description>
		<content:encoded><![CDATA[<p>Try to reset the display string to &#8220;&#8221; to reshow it:</p>
<p>Hide: &#8220;none&#8221;<br />
Show: &#8220;&#8221;</p>
<p>This should work cross-browser.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-2886</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 27 Oct 2004 23:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-2886</guid>
		<description>Hmm... works great in Gecko, fails in IE. Bummer!</description>
		<content:encoded><![CDATA[<p>Hmm&#8230; works great in Gecko, fails in IE. Bummer!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-2885</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Wed, 27 Oct 2004 23:46:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-2885</guid>
		<description>I ran into the same issue that you were having with hiding table rows. In your code give the row a id, then in your CSS set the id to display: none; Now use your javascript code to change the property to display: table-row. This will allow the row to hide and display as you need. That how I solved my issue anyway.</description>
		<content:encoded><![CDATA[<p>I ran into the same issue that you were having with hiding table rows. In your code give the row a id, then in your CSS set the id to display: none; Now use your javascript code to change the property to display: table-row. This will allow the row to hide and display as you need. That how I solved my issue anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-2884</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 27 Oct 2004 22:16:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-2884</guid>
		<description>I&#039;ve read that page, I don&#039;t see the code to hide a row. Perhaps I&#039;m blind and someone could post the syntax I should use?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve read that page, I don&#8217;t see the code to hide a row. Perhaps I&#8217;m blind and someone could post the syntax I should use?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark IJbema</title>
		<link>http://alexking.org/blog/2004/10/27/collapsing-table-rows#comment-2883</link>
		<dc:creator>Mark IJbema</dc:creator>
		<pubDate>Wed, 27 Oct 2004 22:08:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexking.org/blog/2004/10/27/collapsing-table-rows/#comment-2883</guid>
		<description>http://www.w3.org/TR/REC-CSS2/tables.html#q2

It&#039;s standard CSS. It might be that msie doesn&#039;t render it and you need to fix msie (msie isn&#039;t really good with tables, you can&#039;t style non-tables as tables, nor can you style tables an non-tables in msie)</description>
		<content:encoded><![CDATA[<p><a href="http://www.w3.org/TR/REC-CSS2/tables.html#q2" rel="nofollow">http://www.w3.org/TR[...]bles.html#q2</a></p>
<p>It&#8217;s standard CSS. It might be that msie doesn&#8217;t render it and you need to fix msie (msie isn&#8217;t really good with tables, you can&#8217;t style non-tables as tables, nor can you style tables an non-tables in msie)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

