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


Groups > comp.lang.javascript > #13888

Re: Modify Element Tag Question

From "Mel Smith" <med_cutout_syntel@aol.com>
Newsgroups comp.lang.javascript
Subject Re: Modify Element Tag Question
Date 2012-05-12 18:08 -0600
Message-ID <a18cc2Fb03U1@mid.individual.net> (permalink)
References <a158cjFt46U1@mid.individual.net> <lYsm$5DnwqrPFw6K@invalid.uk.co.demon.merlyn.invalid>

Show all headers | View raw


Dr John said:
>
> Ersatz tags will annoy a validator.  Why not use <SPAN> ?  Or use a
> class on the TD elements, and toggle it between one meaning bold and one
> not meaning anything?
>
> OTOH, would <COL> serve?  For me, it does not alter the font; but the
> tested (FF 12) following, which alters the background, may serve.
>        <table border=1>
>        <col><col style="background:cyan"><col>
>        <tr><td>1<td>2<td>3</tr>
>        <tr><td>4<td>5<td>6</tr>
>        <tr><td>7<td>8<td>9</tr>
>        </table>
> To change columns, one needs only alter two entries in the DOM tree,
> which should be possible.
>
> You could class every element in the table with "X" + its row column
> number, and alter the classes as needed.
>


Dr John (and the others):

    My phone book has two visible columns. Each column has 307 cells. Each 
cell has 3 rows

    Each of the rows contains 5 <td> elements for each of the visible 
columns.

    When the user 'clicks' a sorting button (for Name, for street address, 
or for Lot No.), then the following javascript function is called:

    It is this next function that I would like to add (bolding/unbolding) 
code to

    Denis McMahon is the original designer of this fone book. (and I made 
several mods over the last year)

Thanks,

-Mel Smith

********************   one of the fone book table functions below

// build the table from the sorted data
function rebuildTable() {
  var theTable, theCells, i, r, baseRow;
  theTable = document.getElementById("theTable");
  for (i = 0; i < allData.length; i = i + 2) {
    baseRow = 2 + (4 * (i / 2)); // first 2 rows are header & spacer, then 4 
rows for each 2 data records
    // left side data is allData[i];
    // right side data is allData[i+1];
    for (r = 0; r < 3; r = r + 1) { // don't worry about spacer rows, just 
do data rows 0, 1, 2
      theCells = theTable.rows[baseRow + r].cells;
      if (r === 0) {
        theCells[0].innerHTML = allData[i].memName;    // would like to test 
'unbolding' here when address below is bolded
        theCells[1].innerHTML = allData[i].editButt;
        theCells[3].innerHTML = allData[i + 1].memName;
        theCells[4].innerHTML = allData[i + 1].editButt;
      } else if (r === 1) {
        theCells[0].innerHTML = "<b>"+allData[i].localAddr+"</b>";  // 
testing bolding here
        theCells[1].innerHTML = allData[i].lotNum;
        theCells[2].innerHTML = allData[i].localTel;
        theCells[4].innerHTML = "<b>"+allData[i + 1].localAddr+"</b>";
        theCells[5].innerHTML = allData[i + 1].lotNum;
        theCells[6].innerHTML = allData[i + 1].localTel;
      } else if (r === 2) {
        theCells[0].innerHTML = allData[i].otherAddr;
        theCells[1].innerHTML = allData[i].otherTel;
        theCells[3].innerHTML = allData[i + 1].otherAddr;
        theCells[4].innerHTML = allData[i + 1].otherTel;
      }
    }
  }
}

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