Mozilla, colSpan and style.display

  • kroddn
  • Born
  • Born
  • kroddn
  • Posts: 2

Post 3+ Months Ago

Hello,

I have a Problem with mozilla. I have a table which has a cupple of rows like this:

Code: [ Select ]
<tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>

<tr id="stock_tr1246">
<td height="0" align="center" colspan="6" id="stock_td1246" style="display:none;">
  Some Inner Stuff...
</td>
</tr>
  1. <tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
  2. <tr id="stock_tr1246">
  3. <td height="0" align="center" colspan="6" id="stock_td1246" style="display:none;">
  4.   Some Inner Stuff...
  5. </td>
  6. </tr>


As you might see i have a row with 6 cols, that are shown all the time. The second row is hidden by default an will be displayed using this JS:
Code: [ Select ]
function togglestock(sid)
 var stock_tb = document.getElementById("stock1246");
 if (stock_td.style.display == "none") {
  stock_td.style.display = "inline";
 }
 else {
  stock_td.style.display = "none";
 }
}
  1. function togglestock(sid)
  2.  var stock_tb = document.getElementById("stock1246");
  3.  if (stock_td.style.display == "none") {
  4.   stock_td.style.display = "inline";
  5.  }
  6.  else {
  7.   stock_td.style.display = "none";
  8.  }
  9. }


Everything works fine for IE6. My only problem now is that mozilla does'n size the table-cell over 6 columns. It plases the text into the first cell and doesnt cover the other 5 cells.

This one is WRONG (MOZ):
http://www.strength-and-honor-game.de/img/moz.jpg
Image

This one is RIGHT (IE6):
http://www.strength-and-honor-game.de/img/ie.jpg
Image

I would be pleased if somebody could help me!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2194
  • Loc: Canada

Post 3+ Months Ago

Actually Mozilla is correct, It's just that you're trying to get it to look like IE :D
Mozilla doesn't recognize the align: center command (at least in my experience), so in your CSS under stock_td1246's codes, try adding this:
Code: [ Select ]
margin: auto;
  • kroddn
  • Born
  • Born
  • kroddn
  • Posts: 2

Post 3+ Months Ago

I don't think that mozilla is correct. Mozilla doesn't let the me set the colspan to 6 - it just ignores the colspan. IE does interpret it right an treats the column over 6 rows, so the space there is enough.

This example maybe wasn't the best because the "stock" table fits into the first column. But I will have other code where the first column will not be wide enough to hold a stocktable :-)

Thanks for your answer!

Here you see where i have a problem with the colspan
http://www.strength-and-honor-game.de/i ... k_prob.jpg
Image
  • AZinNC
  • Born
  • Born
  • AZinNC
  • Posts: 1
  • Loc: Greenville, NC

Post 3+ Months Ago

I am running into the same issue. I know it has been a while, but have you had any luck with this problem?
  • sachson_bros
  • Born
  • Born
  • sachson_bros
  • Posts: 1

Post 3+ Months Ago

Hi kroddn, AZinNC,

This should fix your problem:

var browser = navigator.appName;
if(browser == "Netscape"){
displayString = "table-row";
} else {
displayString = "block";
}
stock_td.style.display = displayString;

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 51 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.