View Full Version : Switch Content Script IE Table problem

02-25-2005, 05:31 PM
I am currently trying to get this script to work with a table row. I have repeating table rows with information in them. When one is clicked I want below it another table row with the form fields to modify this info in them. It works great in IE. The tables have 5 columns of information..and the drop down table row also has 5 columns ..but when I click the table row to show the hidden table row its all shoved into the first table data cell. I cant figure out why im having this problem. I ended up having to make the drop down table row a colspan of 5 so there was only 1 table data cell. But this causes and unusual gap between the rows. Now if anyone knows how to make this script work with a table row being clicked showing another table row below it both using 5 columns i would greatly appreciate it!
Thanks in advance!

Forgot to mention..this problem occurs in Firefox 1.0! IE it seems to work great

02-25-2005, 06:55 PM
Firefox is very strict when it comes to which elements can be "carved up" arbitrarily. I'm not sure whether you're trying to dynamically contract/ expand TRs or TDs, but if I recall correctly, neither works well in Firefox. Can you try and resort to using DIVs instead? This script works best on block elements such as DIVs and Paragraphs.

02-25-2005, 07:11 PM
Yeah I did resort to using divs. I have my initial table row with 5 columns then my row i want displayed when clicked is 1 column (colspan=5) with a div inside of it. This works but it causes a small gap between the table rows And my data is not directly lined up with what is in the previous row. Im just really big on displaying data with tables =\ I have no idea how I would go about displaying information in columns with any other method..i know CSS is probably the way to go just havent learned it.

Thanks for the reply..Ill just deal with the small gap for now until something else can be figured out..or i can jsut get rid of tables =P

12-03-2005, 11:10 AM
I finally figured this out, here's what I did....

Move the id and class up to the <tr> instead of the <td>

<tr id="sc3" class="switchcontent">
<td class="whatever_class">bla bla</td>
<td class="whatever_class">bla bla</td>
<td class="whatever_class">bla bla</td>
<td class="whatever_class">bla bla</td>
<td class="whatever_class">bla bla</td>