473,324 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

how to hide a div inside a table.

2
I want to hide a div which is inside a table .

Expand|Select|Wrap|Line Numbers
  1. var tableString = "<div><table border=\"8\" cellpadding=\"6\" cellspacing=\"4\"><tr>";
  2.  
  3. for(var ii=0;ii<noOfWidgets;ii++)
  4.             {
  5.  
  6. st2= "\'" + st2 + "\'";
  7.              var ii_string = ii + "";
  8.             tableString =tableString.concat('<div id= '+ii_string+'><td><IMG SRC='+'\"'+st+'\" onclick="' + this.getCompleteiContextIdentifier() +'.iScope().onmyClick('+st2+','+ii_string+','+noOfWidgets+');" /></td></div>');
  9. }
  10.         tableString = tableString.concat("</tr></table></div>");
  11.         element.innerHTML = tableString;
  12. },
  13.     onmyClick : function(widget_id,currentWidget,noOfWidgets){
  14.         currentWidget_string= currentWidget+ "";
  15.         for(var i=0;i<noOfWidgets;i++){
  16.       if(i==currentWidget)
  17.       { 
  18.       alert(this.iContext.getElementById(currentWidget_string).innerHTML);
  19.       this.iContext.getElementById(currentWidget_string).style.display= 'none';
  20.       }
  21.       else
  22.       this.iContext.getElementById(currentWidget_string).style.visibility = 'visible';
  23.         }      
  24. }
Mar 28 '10 #1
2 2930
RamananKalirajan
608 512MB
Hi Snell,
You want to hide the div <div id= '+ii_string+'> inisde the table element you have created dynamically. If you want to maintain the space means use style.visibility='hidden' if u dont want to maintain the space use style.display='none' for that div.

Ex Code:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById(divId).style.visibility='hidden';
  2. document.getElementById(divId).style.display='none';
Thanks and Regards
Ramanan Kalirajan
Mar 29 '10 #2
snell
2
Thanks Ramanan.

Its working now .. :)
Mar 30 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Thomas Abraham | last post by:
Hi, The following code to show and hide a row works fine in netscape 7 and IE 6. But everytime the cell is hidden and displayed in netscape, it adds a new line inside the cell. Please advise....
7
by: Mad Scientist Jr | last post by:
Through messing around I got IE6 (win xp) to show/hide a table row. I gave my <TR> an ID of "trRow" and trRow.style.display='none'; hides it trRow.style.display='block'; displays it (will any...
10
by: oLE | last post by:
I would like to add some javascript to show/hide a certain row of a table. The first row of the table contain the hyperlink that calls the javascript the second row is the one i want to show/hide...
4
by: Konrad Viltersten | last post by:
As it isnow i have to use a syntax for my tables as: <table class = "some" border> and/or <table class = "some" noborder> Now, what i'd like to do is to make that border-thingy...
12
by: Jerad Rose | last post by:
I searched for a while trying to find the answer to this, but to no avail. I am trying to find the best way (or any way) to dynamically show and hide groups of TR's. For example, I have a...
11
by: jimstruckster | last post by:
I have a table with 10 rows, I want all rows except for the first to be hidden when the page first opens up. If the user puts a value in a text box in the first row then I want the second row to...
1
by: filch | last post by:
Hi, I am new to this forum ... so hello to all! I am trying to get a script working which will show or hide a table based on a user checking or unchecking a parent checkbox. This is the...
3
by: timplx | last post by:
Hello all, New to javascript and have never worked with programming languages like c++, so my logic in some of these statements might be incorrect or redundant Got a problem with my page......
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.