Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: SV: Re: SV: RE:SV: TD HIGHLIGHT


Message #1 by "Robert Nyman" <robert.nyman@c...> on Thu, 3 Oct 2002 14:31:54 +0200
Yeah,

well just see what Claudio choses and hope that it works out for him.
And thank you for the positive feedback!  :-)


/Robert


-----Ursprungligt meddelande-----
Fr=E5n: Gautam Khanna [mailto:gautamkhanna27@y...]
Skickat: den 3 oktober 2002 14:00
Till: JavaScript HowTo
=C4mne: [javascript_howto] Re: SV: RE:SV: TD HIGHLIGHT



yup u r correct ...if 48th & 104 element features in wrong TR,  then
ofcourse...
well one good solution would be & no need to thnk it later { ofcourse to
make it more simpler .}....
use a Boolean Variable with on/off switch which doesn't require any
extra  headaches of memory processings within the scope...
Hope Claudio would appreciate this
& yaa i do read ur mails which r quite superb & ya good for any JS
programmers.. Good Job done Robert..
Regards
Gautam Khanna
gautamkhanna27@y...

 Robert Nyman wrote:Hi Gautam,

using the modulus operator, does that help in this case?
I haven't used it extensively, so I don't know, but would it work in
this case?

I mean, in your code, if intValue would be 48 or 104, it would both
result in "true" an the color would be "blue". Am I right, or is there
something I'm missing?


Humbly,
Robert


-----Ursprungligt meddelande-----
Fr=E5n: Gautam Khanna [mailto:gautamkhanna27@y...]
Skickat: den 3 oktober 2002 12:45
Till: JavaScript HowTo
=C4mne: [javascript_howto] RE:SV: TD HIGHLIGHT



Hi Claudio,,
well Gaurav Here let me make ur Life a bit simple use this
i hope this is some what of refining of Roberts Code...
well he was toggling between the cells thats y he was using it any way u
can try this as is bit simpler to understand as it meets ur requirements

Regards
Gautam Khanna
gautamkhanna27@y...


************************************************************************
********************



window.onload =3D Gaurav;

function Robert()
{
 var arrTables =3Ddocument.getElementsByTagName("table");
 for(var i=3D0; i  var arrAllCurrentTableCells
=3DarrTables[i].getElementsByTagName("td");
  for(var j=3D0; j   var oTD =3D arrAllCurrentTableCells[j];
   var intValue =3D parseInt(oTD.innerHTML, 10);
  //If you're only targetting IE, then exhange innerHTML to innerText
   if(intValue  100){
    oTD.style.color =3D"white";
    oTD.style.backgroundColor =3D(intValue    }
  }
 }
}

function Gaurav()
{
 var arrTables =3Ddocument.getElementsByTagName("table");
 for(var i=3D0; i  var arrAllCurrentTableCells
=3DarrTables[i].getElementsByTagName("td");
  for(var j=3D0; j  {
   var oTD =3D arrAllCurrentTableCells[j];
   var backColor =3D (j%2)?"blue":"red";
   oTD.style.color =3D"white"; oTD.style.backgroundColor =3DbackColor;
  }
 }
}










103
49
76


49
103
76





49
76
103


76
49
103




************************************************************************
***************




---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to 


---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20


  Return to Index