Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #13902

Re: Modify Element Tag Question

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "Mel Smith" <med_cutout_syntel@aol.com>
Newsgroups comp.lang.javascript
Subject Re: Modify Element Tag Question
Date Sun, 13 May 2012 09:00:01 -0600
Lines 58
Message-ID <a1a0jkF6h0U1@mid.individual.net> (permalink)
References <a158cjFt46U1@mid.individual.net> <4faf23ae$0$2892$a8266bb1@newsreader.readnews.com>
X-Trace individual.net Lvc320OiAiHktGkCY9Q7GA/veSCRc5xVWHC0vxDBsHXAJFSr43Vz6jSKuSVjLiJxOo
Cancel-Lock sha1:kkGr+xoVinIdH8MCKMjvmmVVyF0=
X-Priority 3
X-MSMail-Priority Normal
X-Newsreader Microsoft Outlook Express 6.00.2900.5931
X-RFC2646 Format=Flowed; Original
X-MimeOLE Produced By Microsoft MimeOLE V6.00.2900.6157
Xref csiph.com comp.lang.javascript:13902

Show key headers only | View raw


Denis said:

> The way I think I would do it, assuming that each row has a series of td
> elements ....
>
> To the td elements that contain names, I would add 'class="name"', and to
> the td elements that hold addresses, I would add 'class="addr"'
>
> Then, as an appendage to the sort routines, call something like boldCells
> as shown below with either "name" or "addr" (it can be expanded to other
> fields if needed):
>
> function boldCells( embolden ) {
>  var cells = document.getElementsByTagName( "td" );
>  var ix = cells.length;
>  var cell, class;
>  while ( ix-- ) {
>    cell = cells.item( ix );
>    class = cell.attributes.getNamedItem( "class" );
>    if ( class.indexOf( "name" ) != -1 ) {
>      if ( embolden == "name" )
>        cell.style.fontWeight = "bold";
>      else
>        cell.style.fontWeight = "normal";
>    }
>    else if ( class.indexOf( "addr" ) != -1 ) {
>      if ( embolden == "addr" )
>        cell.style.fontWeight = "bold";
>      else
>        cell.style.fontWeight = "normal";
>    }
> }
>
> Note - code is untested!
>
> Basically, boldCells will look at all the td cells in the document for
> any with one of the defined class attributes, and apply either bold or
> normal font-weight to each of the matching cells depending on whether the
> cell's actual class matches the one passed to the boldCells function.
> Cells which don't match any of the defined cell classes won't be affected
> at all, so if they are bold they will stay bold, and if they are not bold
> they will remain not bold.
>

Hi Denis:

    Will look carefully at the suggestions above, and test the 
implementation.

    btw, your design has worked flawlessly over the past year, and the 
residents of my Senior's Park, and the office lady really appreciate your 
work.

Thanks you very much !

-Mel Smith

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Modify Element Tag Question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-11 13:42 -0600
  Re: Modify Element Tag Question Martin Honnen <mahotrash@yahoo.de> - 2012-05-12 12:00 +0200
    Re: Modify Element Tag Question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-05-12 15:02 +0200
      Re: Modify Element Tag Question John G Harris <john@nospam.demon.co.uk> - 2012-05-12 16:15 +0100
        Re: Modify Element Tag Question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-12 14:32 -0600
  Re: Modify Element Tag Question Dr J R Stockton <reply1219@merlyn.demon.co.uk.not.invalid> - 2012-05-12 19:29 +0100
    Re: Modify Element Tag Question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-12 18:08 -0600
      Re: Modify Element Tag Question "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-05-13 08:11 +0000
    Re: Modify Element Tag Question Martin Honnen <mahotrash@yahoo.de> - 2012-05-13 11:25 +0200
      Re: Modify Element Tag Question Dr J R Stockton <reply1220@merlyn.demon.co.uk.not.invalid> - 2012-05-14 20:19 +0100
  Re: Modify Element Tag Question Denis McMahon <denismfmcmahon@gmail.com> - 2012-05-13 02:59 +0000
    Re: Modify Element Tag Question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-05-13 15:50 +0200
      Re: Modify Element Tag Question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-13 08:56 -0600
      Re: Modify Element Tag Question Dr J R Stockton <reply1219@merlyn.demon.co.uk.not.invalid> - 2012-05-14 20:01 +0100
    Re: Modify Element Tag Question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-13 09:00 -0600
      Re: Modify Element Tag Question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-14 08:45 -0600
        Re: Modify Element Tag Question Scott Sauyet <scott.sauyet@gmail.com> - 2012-05-14 16:31 -0700
          Re: Modify Element Tag Question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-15 09:03 -0600
        Re: Modify Element Tag Question Dr J R Stockton <reply1220@merlyn.demon.co.uk.not.invalid> - 2012-05-15 20:04 +0100
          Re: Modify Element Tag Question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-15 22:19 -0600
            Re: Modify Element Tag Question Dr J R Stockton <reply1220@merlyn.demon.co.uk.not.invalid> - 2012-05-17 19:13 +0100
              Re: Modify Element Tag Question Scott Sauyet <scott.sauyet@gmail.com> - 2012-05-17 18:48 -0700
                Re: Modify Element Tag Question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-18 13:14 -0600
                Re: Modify Element Tag Question Dr J R Stockton <reply1220@merlyn.demon.co.uk.not.invalid> - 2012-05-19 20:47 +0100
                Re: Modify Element Tag Question "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-05-20 08:31 +0000
                Re: Modify Element Tag Question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-20 18:25 -0600
                Re: Modify Element Tag Question "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-05-21 16:06 +0000
                Re: Modify Element Tag Question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-21 13:24 -0600
                Re: Modify Element Tag Question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-21 13:34 -0600
                Re: Modify Element Tag Question Scott Sauyet <scott.sauyet@gmail.com> - 2012-05-21 13:09 -0700
                Re: Modify Element Tag Question Dr J R Stockton <reply1221@merlyn.demon.co.uk.not.invalid> - 2012-05-21 20:33 +0100

csiph-web