Taking Control of a table?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Craig

    #1

    Taking Control of a table?

    I have a 3rd party product that is quite old.

    It produces reports dynamically via the web.

    It users templates to do this.

    They are very basic, one looks like this.

    <html>
    <head>
    <meta name="author" >
    </head>

    <body>

    <center>
    <table cellpadding=3 cellspacing=0>
    %REPORT%
    </table>
    </center>
    </body>

    </html>

    Where the %report% variable is, this gets replaced with rows of data
    (ie. <tr></tr>). The problem is that it translates the fonts from the
    Report into very old html code.

    Like this

    <TR>
    <TD NOWRAP ALIGN="left"><F ONT FACE="Arial" SIZE=3><IMG
    SRC="/images/empty.gif"> Net Trade Working Capital</FONT></TD>
    <TD ALIGN="right">< FONT FACE="Arial" SIZE=3>147,345. 00</FONT></TD>
    <TD ALIGN="right">< FONT FACE="Arial" SIZE=3>70,111.0 0</FONT></TD>
    <TD ALIGN="right">< FONT FACE="Arial" SIZE=3>110.16</FONT></TD>
    <TD>&nbsp;</TD>
    <TD>&nbsp;</TD>
    </TR>

    So with it having the font face styles in every column can we right
    code to overwrite this?

    I want to take control of the table and be able to set the row height
    on row 1 where the headers go, also would like to set column
    widths/colours etc.

    Any ideas would be great

    Regards

    Craig
  • Ivo

    #2
    Re: Taking Control of a table?

    "Craig" wrote[color=blue]
    > I have a 3rd party product that is quite old.
    >
    > It produces reports dynamically via the web.
    >
    > It users templates to do this.
    >
    > They are very basic, one looks like this.[/color]
    [color=blue]
    > <TR>
    > <TD NOWRAP ALIGN="left"><F ONT FACE="Arial" SIZE=3><IMG
    > SRC="/images/empty.gif"> Net Trade Working Capital</FONT></TD>
    > <TD ALIGN="right">< FONT FACE="Arial" SIZE=3>147,345. 00</FONT></TD>
    > <TD ALIGN="right">< FONT FACE="Arial" SIZE=3>70,111.0 0</FONT></TD>
    > <TD ALIGN="right">< FONT FACE="Arial" SIZE=3>110.16</FONT></TD>
    > <TD>&nbsp;</TD>
    > <TD>&nbsp;</TD>
    > </TR>
    >
    > So with it having the font face styles in every column can we right
    > code to overwrite this?
    >
    > I want to take control of the table and be able to set the row height
    > on row 1 where the headers go, also would like to set column
    > widths/colours etc.[/color]

    Using DOM or innerHTML methods you can shape and style things to your
    heart's content, ie. remove the font tags entirely and replace them with the
    text inside. But it would really be better to do this on the serverside,
    before sending the code to the client.
    --
    Ivo


    Comment

    • Robert

      #3
      Re: Taking Control of a table?

      cmc_dermo@yahoo .co.uk (Craig) wrote in message news:<7baf4f57. 0410020707.2f8e bd60@posting.go ogle.com>...[color=blue]
      > I have a 3rd party product that is quite old.
      >
      > It produces reports dynamically via the web.
      >
      > It users templates to do this.
      >
      > They are very basic, one looks like this.[/color]


      I wrote up an example file. The text does flash on my computer. I
      tried this in Netscape 7.2, IE 5.2, and Safari 1.0 on MacOS 10.2.6.
      You could hide the table untile you were done changing it.

      The image src tag may have wrapped.

      Robert

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">
      <html>
      <head>
      <meta name="author" >
      <title>Overri de inline fonts</title>
      <style type="text/css">

      td { font-size: xx-large;
      color: green;
      font-family: cursive;
      }
      </style>

      <script type="text/javascript">
      function adjust()
      {
      var t, theFonts, rows;

      // Verify that we have the needed methods.
      if (document.getEl ementById &&
      document.getEle mentsByTagName)
      {
      // Start looking at the beginning of the table
      t = document.getEle mentById("mytab le");

      // Find all rows withing the table
      rows = t.getElementsBy TagName("tr");

      // Find all the font tags in the first row.
      // I know there is only one row, so I skipped
      // the for loop.
      theFonts = rows[0].getElementsByT agName("font");

      /*
      Font tag properties have priority over CSS attributes.
      I will blank out the font propeties that I want the CSS
      rules to apply to. I'll set the color to blue to
      show how you can change a font property.
      */
      for (var i = 0; i<theFonts.leng th; i++)
      {
      theFonts[i].face = "";
      theFonts[i].size = "";
      theFonts[i].color = "blue";
      }
      }
      }
      </script>
      </head>

      <body id="documentbod y" onload="adjust( );">
      <p>We will change this table after the page loads.</p>
      <center>
      <table id="mytable" cellpadding=3 cellspacing=0>
      <TR>
      <TD NOWRAP ALIGN="left">
      <FONT FACE="Arial"
      SIZE=3><IMG
      SRC="http://spaceplace.nasa .gov/en/educators/images/solarsystem/idadactyl_T.jpg "
      weight="10px"
      height="10px"> Net Trade Working Capital</FONT></TD>
      <TD ALIGN="right">
      <FONT FACE="Arial"
      SIZE=3
      color="red">147 ,345.00</FONT></TD>
      <TD ALIGN="right">
      <FONT FACE="Arial"
      SIZE=3>70,111.0 0</FONT></TD>
      <TD ALIGN="right">
      <FONT FACE="Arial"
      SIZE=3>110.16</FONT></TD>
      <TD>&nbsp;</TD>
      <TD>&nbsp;</TD>
      </TR>
      </table>
      </center>

      </body>

      </html>

      Comment

      • Hal Rosser

        #4
        Re: Taking Control of a table?


        "Craig" <cmc_dermo@yaho o.co.uk> wrote in message
        news:7baf4f57.0 410020707.2f8eb d60@posting.goo gle.com...[color=blue]
        > I have a 3rd party product that is quite old.
        >
        > It produces reports dynamically via the web.
        >
        > It users templates to do this.
        >
        > They are very basic, one looks like this.
        >
        > <html>
        > <head>
        > <meta name="author" >
        > </head>
        >
        > <body>
        >
        > <center>
        > <table cellpadding=3 cellspacing=0>
        > %REPORT%
        > </table>
        > </center>
        > </body>
        >
        > </html>
        >
        > Where the %report% variable is, this gets replaced with rows of data
        > (ie. <tr></tr>). The problem is that it translates the fonts from the
        > Report into very old html code.
        >
        > Like this
        >
        > <TR>
        > <TD NOWRAP ALIGN="left"><F ONT FACE="Arial" SIZE=3><IMG
        > SRC="/images/empty.gif"> Net Trade Working Capital</FONT></TD>
        > <TD ALIGN="right">< FONT FACE="Arial" SIZE=3>147,345. 00</FONT></TD>
        > <TD ALIGN="right">< FONT FACE="Arial" SIZE=3>70,111.0 0</FONT></TD>
        > <TD ALIGN="right">< FONT FACE="Arial" SIZE=3>110.16</FONT></TD>
        > <TD>&nbsp;</TD>
        > <TD>&nbsp;</TD>
        > </TR>
        >
        > So with it having the font face styles in every column can we right
        > code to overwrite this?
        >
        > I want to take control of the table and be able to set the row height
        > on row 1 where the headers go, also would like to set column
        > widths/colours etc.[/color]

        Have you tried using CSS ?


        ---
        Outgoing mail is certified Virus Free.
        Checked by AVG anti-virus system (http://www.grisoft.com).
        Version: 6.0.770 / Virus Database: 517 - Release Date: 9/27/2004


        Comment

        • Craig

          #5
          Re: Taking Control of a table?

          Thanks for the reply and example.

          I think that does what I want, how do I get this to work with more
          rows and also hide the initial table that gets loaded.

          Once again, many thanks for your efforts!

          mc_dermo@yahoo. co.uk (Craig) wrote in message news:<7baf4f57. 0410020707.2f8e bd60@posting.go ogle.com>...[color=blue]
          > I have a 3rd party product that is quite old.
          >
          > It produces reports dynamically via the web.
          >
          > It users templates to do this.
          >
          > They are very basic, one looks like this.
          >
          > <html>
          > <head>
          > <meta name="author" >
          > </head>
          >
          > <body>
          >
          > <center>
          > <table cellpadding=3 cellspacing=0>
          > %REPORT%
          > </table>
          > </center>
          > </body>
          >
          > </html>
          >
          > Where the %report% variable is, this gets replaced with rows of data
          > (ie. <tr></tr>). The problem is that it translates the fonts from the
          > Report into very old html code.
          >
          > Like this
          >
          > <TR>
          > <TD NOWRAP ALIGN="left"><F ONT FACE="Arial" SIZE=3><IMG
          > SRC="/images/empty.gif"> Net Trade Working Capital</FONT></TD>
          > <TD ALIGN="right">< FONT FACE="Arial" SIZE=3>147,345. 00</FONT></TD>
          > <TD ALIGN="right">< FONT FACE="Arial" SIZE=3>70,111.0 0</FONT></TD>
          > <TD ALIGN="right">< FONT FACE="Arial" SIZE=3>110.16</FONT></TD>
          > <TD>&nbsp;</TD>
          > <TD>&nbsp;</TD>
          > </TR>
          >
          > So with it having the font face styles in every column can we right
          > code to overwrite this?
          >
          > I want to take control of the table and be able to set the row height
          > on row 1 where the headers go, also would like to set column
          > widths/colours etc.
          >
          > Any ideas would be great
          >
          > Regards
          >
          > Craig[/color]

          Comment

          • Andrew Thompson

            #6
            Re: Taking Control of a table?

            On 3 Oct 2004 03:28:07 -0700, Craig wrote:
            [color=blue]
            > Thanks ..[/color]

            Who?
            [color=blue]
            >..for the reply and example.[/color]

            I notice you are posting from Google, Craig.

            Your responses are not 'threading' correctly beneath
            the articles to which you are replying, so it might
            pay to copy/paste a little of the text in your reply.

            Of course, it is usually easier all round (assuming
            you have your own internet connection) to use a news-client
            to access the groups. News-clients include Gravity, 40tude
            Dialog and Outlook Express.

            --
            Andrew Thompson
            http://www.PhySci.org/codes/ Web & IT Help
            http://www.PhySci.org/ Open-source software suite
            http://www.1point1C.org/ Science & Technology
            http://www.lensescapes.com/ Images that escape the mundane

            Comment

            • Robert

              #7
              Re: Taking Control of a table?

              "Hal Rosser" <hmrosser@bells outh.net> wrote in message news:<6VL7d.129 806$Np2.51427@b ignews4.bellsou th.net>...[color=blue]
              >
              > Have you tried using CSS ?
              >[/color]
              I tried:

              <style type="text/css">

              td { font-size: xx-large;
              color: green !important;
              font-family: cursive !important;
              }
              </style>

              but found that <font> information has priority over style information.
              The !important directive does override inline style information.

              Robert

              Comment

              • Michael Winter

                #8
                Re: Taking Control of a table?

                On 3 Oct 2004 07:57:39 -0700, Robert <rccharles@my-deja.com> wrote:

                [snip]
                [color=blue]
                > td { font-size: xx-large;[/color]

                It's best to use percentages or em units to specify font sizes. This
                allows more flexibility should the user want to zoom content in or out. If
                you use percentages, always specify

                body {
                font-size: 100%;
                }

                to avoid IE bugs.

                [snip]
                [color=blue]
                > but found that <font> information has priority over style information.
                > The !important directive does override inline style information.[/color]

                It won't. A property of the cascade is that the most specific selector
                takes precedence over the less specific. If inline style data specifies a
                property that has been set in a style sheet, the style sheet-specified
                property will be ignored. I assume the FONT element acts in this manner.

                The first thing you could attempt to do is (remembering to include feature
                detection):

                var t = document.getEle mentById('mytab le'),
                f = t.getElementsBy TagName('FONT') ;

                for(var i = 0, m = f.length, c, p; i < m; ++i) {
                c = f[i]; p = c.parentNode;
                for(var j = 0, cN = c.childNodes, n = cN.length; j < n; ++j) {
                p.insertBefore( cN[j], c);
                }
                p.removeChild(c );
                }

                thereby removing all FONT elements from the table. Assuming that there is
                no more inline style data, your style sheet settings should have an effect.

                If this is for the Web, it would be best to try and preprocess the code
                before making it available, rather than relying on script.

                Mike

                --
                Michael Winter
                Replace ".invalid" with ".uk" to reply by e-mail.

                Comment

                • Robert

                  #9
                  Re: Taking Control of a table?

                  cmc_dermo@yahoo .co.uk (Craig) wrote in message news:<7baf4f57. 0410030228.10cf 5024@posting.go ogle.com>...[color=blue]
                  > Thanks for the reply and example.
                  >
                  > I think that does what I want, how do I get this to work with more
                  > rows and also hide the initial table that gets loaded.[/color]

                  Have a look at this example.

                  I suggest using firefox to see how the DOM. In firefox, do Tools ->
                  DOM Inspector. Click on the little arrows to go down. You will have
                  to click sever or eight times to get to the font tag.

                  The img src attribute text could have wrapped.

                  Robert

                  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                  "http://www.w3.org/TR/html4/loose.dtd">
                  <html>
                  <head>
                  <meta name="author" >
                  <title>Overri de inline fonts</title>
                  <style type="text/css">
                  #mytable {visibility: hidden;
                  }

                  /* Show how once font attributes are removed, we can use
                  the style attributes. */
                  tr td { font-size: x-large;
                  font-family: cursive;
                  }

                  /* This is the id for the first cell in the table */
                  #row1cell1 { text-decoration: underline;
                  width: 400px;
                  height: 60px;}

                  /* Here is the last */
                  #row2cell4 { text-decoration: underline; }

                  </style>

                  <script type="text/javascript">
                  function adjust()
                  {
                  var t, theFonts, rows, theIds;

                  // Verify that we have the needed methods.
                  if (document.getEl ementById &&
                  document.getEle mentsByTagName)
                  {
                  // Start looking at the beginning of the table
                  t = document.getEle mentById("mytab le");

                  // Find all rows withing the table
                  rows = t.getElementsBy TagName("tr");


                  // Examine one row at a time.
                  for (var rowsLoop = 0; rowsLoop<rows.l ength; rowsLoop++)
                  {
                  theFonts =
                  rows[rowsLoop].getElementsByT agName("font");
                  /*
                  Font tag properties have priority over CSS
                  attributes. I will blank out the font propeties
                  that I want the CSS rules to apply to. I'll set
                  the color to blue to show how you can change a
                  font property.
                  */
                  // Find all the font tags in the row.
                  for (var i = 0; i<theFonts.leng th; i++)
                  {
                  if (theFonts[i].removeAttribut e)
                  {
                  theFonts[i].removeAttribut e("face");
                  theFonts[i].removeAttribut e("size");
                  }
                  else
                  {
                  // Well, nulling seems to work too.
                  theFonts[i].face = "";
                  theFonts[i].size = "";
                  }

                  theFonts[i].color = "blue";
                  }
                  // Zap in an id
                  // Please note the first cell in the table
                  // is row1cell1.
                  theIds =
                  rows[rowsLoop].getElementsByT agName("td");
                  for (var j = 0; j<theIds.length ; j++)
                  {
                  theIds[j].id = "row" + ( rowsLoop + 1 ) +
                  "cell" + ( j + 1) ;

                  }

                  } // end of loop on rows

                  // Display the table
                  if (t.style)
                  { t.style.visibil ity = "visible"; }
                  else
                  {
                  alert("Oh, we have a table to display, " +
                  "but we cannot.");
                  }
                  }

                  }
                  </script>
                  </head>

                  <body id="documentbod y" onload="adjust( );">
                  <p>We will change this table after the page loads.</p>
                  <center>
                  <table id="mytable" cellpadding=3 cellspacing=0>
                  <TR>
                  <TD nowrap ALIGN="left">
                  <FONT FACE="Arial"
                  SIZE=3><IMG
                  SRC="http://spaceplace.nasa .gov/en/educators/images/solarsystem/idadactyl_T.jpg "
                  weight="10px"
                  height="10px"> Net Trade Working Capital</FONT></TD>
                  <TD ALIGN="right">
                  <FONT FACE="Arial"
                  SIZE=3
                  color="red">147 ,345.00</FONT></TD>
                  <TD ALIGN="right">
                  <FONT FACE="Arial"
                  SIZE=3>70,111.0 0</FONT></TD>
                  <TD ALIGN="right">
                  <FONT FACE="Arial"
                  SIZE=3>110.16</FONT></TD>
                  <TD>&nbsp;</TD>
                  <TD>&nbsp;</TD>
                  </TR>
                  <TR>
                  <TD nowrap ALIGN="left">
                  <FONT FACE="Arial"
                  SIZE=3><IMG
                  SRC="http://spaceplace.nasa .gov/en/educators/images/solarsystem/idadactyl_T.jpg "
                  weight="10px"
                  height="10px"> Net Trade Reserve Capital</FONT></TD>
                  <TD ALIGN="right">
                  <FONT FACE="Arial"
                  SIZE=3>7,345.00 </FONT></TD>
                  <TD ALIGN="right">
                  <FONT FACE="Arial"
                  SIZE=3
                  color="red">7,1 11.00</FONT></TD>
                  <TD ALIGN="right">
                  <FONT FACE="Arial"
                  SIZE=3>11.16</FONT></TD>
                  <TD>&nbsp;</TD>
                  <TD>&nbsp;</TD>
                  </TR>
                  </table>
                  </center>
                  </body>

                  </html>

                  Comment

                  • Robert

                    #10
                    Re: Taking Control of a table?

                    In article <opsfawewpgx13k vk@atlantis>,
                    "Michael Winter" <M.Winter@bluey onder.co.invali d> wrote:

                    [color=blue]
                    > thereby removing all FONT elements from the table. Assuming that there is
                    > no more inline style data, your style sheet settings should have an effect.[/color]

                    Thanks. I tried to remove the font tags, but I didn't get the code to
                    work.

                    Robert

                    Comment

                    • Michael Winter

                      #11
                      Re: Taking Control of a table?

                      On Mon, 04 Oct 2004 06:49:19 GMT, Robert <rccharles@my-deja.com> wrote:

                      [snip]
                      [color=blue]
                      > Thanks. I tried to remove the font tags, but I didn't
                      > get the code to work.[/color]

                      Sorry. I forgot that DOM collections were live. That is, when you modify
                      the document, the returned collection is modified too. As the original
                      code deleted FONT elements, and when it moved the children of those
                      elements, the collections, f and cN, were getting shorter eventually
                      causing an out-of-bounds error. Working backwards through them is one
                      approach:

                      var t = document.getEle mentById('myTab le'),
                      f = t.getElementsBy TagName('FONT') ,
                      i = f.length;

                      while(i--) {
                      var c = f[i], p = c.parentNode, cN = c.childNodes, j = cN.length;
                      while(j--) {p.insertBefore (cN[j], c.nextSibling); }
                      p.removeChild(c );
                      }

                      A feature detection version might go:

                      function isD(o) {return 'undefined' != typeof o;}
                      if(document.get ElementById) {
                      var t = document.getEle mentById('myTab le');

                      if(t && t.getElementsBy TagName) {
                      var f = t.getElementsBy TagName('FONT') ,
                      i = f.length;

                      if(i) {
                      var c = f[0], p = c.parentNode;
                      if(p && p.insertBefore && p.removeChild && isD(c.childNode s)
                      && isD(c.nextSibli ng))
                      {
                      while(i--) {
                      c = f[i]; p = c.parentNode;
                      var cN = c.childNodes, j = cN.length;
                      while(j--) {p.insertBefore (cN[j], c.nextSibling); }
                      p.removeChild(c );
                      }
                      }
                      }
                      }
                      }

                      Mike

                      --
                      Michael Winter
                      Replace ".invalid" with ".uk" to reply by e-mail.

                      Comment

                      • Ivo

                        #12
                        Re: Taking Control of a table?

                        "Robert" wrote[color=blue][color=green]
                        > > Have you tried using CSS ?
                        > >[/color]
                        > I tried:
                        >
                        > <style type="text/css">
                        >
                        > td { font-size: xx-large;
                        > color: green !important;
                        > font-family: cursive !important;
                        > }
                        > </style>
                        >
                        > but found that <font> information has priority over style information.
                        > The !important directive does override inline style information.[/color]

                        Have your CSS define rules for the font elements directly, not the td. Then
                        the cascade will work as you wish:

                        <style type="text/css">
                        font{font-family:Arial,sa ns-serif}
                        </style>
                        <font face="Times">
                        Look ma, no serifs!
                        </font>

                        --
                        Ivo



                        Comment

                        • Robert

                          #13
                          Re: Taking Control of a table?

                          "Michael Winter" <M.Winter@bluey onder.co.invali d> wrote in message news:<opsfb7atf xx13kvk@atlanti s>...[color=blue]
                          > On Mon, 04 Oct 2004 06:49:19 GMT, Robert <rccharles@my-deja.com> wrote:
                          >
                          > [snip]
                          >[color=green]
                          > > Thanks. I tried to remove the font tags, but I didn't
                          > > get the code to work.[/color]
                          >
                          > Sorry. I forgot that DOM collections were live.[/color]


                          Oh, I had meant to say that I had written up some code that made an
                          attempt to delete the font tags. The code that I had written didn't
                          work, so I changed to deleting the font attributes.

                          I did assume that the returned 'array' was fixed.

                          I'll study your new version.

                          Robert

                          Comment

                          • Craig

                            #14
                            Re: Taking Control of a table?

                            Robert thanks very much for the code.

                            It works well and I understand what's going on!

                            A few more questions.

                            Rather than have to set the style for every cell individually in the
                            first row, can I just set the style for the whole row? I would also
                            like to hide certain rows, i understand I use the hidden function for
                            this but how do I specify the rows I want to hide, for example I want
                            to hide row 2.

                            Once again many thanks!

                            Craig

                            rccharles@my-deja.com (Robert) wrote in message news:<c6bb75ff. 0410030851.4e7f b9a4@posting.go ogle.com>...[color=blue]
                            > cmc_dermo@yahoo .co.uk (Craig) wrote in message news:<7baf4f57. 0410030228.10cf 5024@posting.go ogle.com>...[color=green]
                            > > Thanks for the reply and example.
                            > >
                            > > I think that does what I want, how do I get this to work with more
                            > > rows and also hide the initial table that gets loaded.[/color]
                            >
                            > Have a look at this example.
                            >
                            > I suggest using firefox to see how the DOM. In firefox, do Tools ->
                            > DOM Inspector. Click on the little arrows to go down. You will have
                            > to click sever or eight times to get to the font tag.
                            >
                            > The img src attribute text could have wrapped.
                            >
                            > Robert
                            >
                            > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                            > "http://www.w3.org/TR/html4/loose.dtd">
                            > <html>
                            > <head>
                            > <meta name="author" >
                            > <title>Overri de inline fonts</title>
                            > <style type="text/css">
                            > #mytable {visibility: hidden;
                            > }
                            >
                            > /* Show how once font attributes are removed, we can use
                            > the style attributes. */
                            > tr td { font-size: x-large;
                            > font-family: cursive;
                            > }
                            >
                            > /* This is the id for the first cell in the table */
                            > #row1cell1 { text-decoration: underline;
                            > width: 400px;
                            > height: 60px;}
                            >
                            > /* Here is the last */
                            > #row2cell4 { text-decoration: underline; }
                            >
                            > </style>
                            >
                            > <script type="text/javascript">
                            > function adjust()
                            > {
                            > var t, theFonts, rows, theIds;
                            >
                            > // Verify that we have the needed methods.
                            > if (document.getEl ementById &&
                            > document.getEle mentsByTagName)
                            > {
                            > // Start looking at the beginning of the table
                            > t = document.getEle mentById("mytab le");
                            >
                            > // Find all rows withing the table
                            > rows = t.getElementsBy TagName("tr");
                            >
                            >
                            > // Examine one row at a time.
                            > for (var rowsLoop = 0; rowsLoop<rows.l ength; rowsLoop++)
                            > {
                            > theFonts =
                            > rows[rowsLoop].getElementsByT agName("font");
                            > /*
                            > Font tag properties have priority over CSS
                            > attributes. I will blank out the font propeties
                            > that I want the CSS rules to apply to. I'll set
                            > the color to blue to show how you can change a
                            > font property.
                            > */
                            > // Find all the font tags in the row.
                            > for (var i = 0; i<theFonts.leng th; i++)
                            > {
                            > if (theFonts[i].removeAttribut e)
                            > {
                            > theFonts[i].removeAttribut e("face");
                            > theFonts[i].removeAttribut e("size");
                            > }
                            > else
                            > {
                            > // Well, nulling seems to work too.
                            > theFonts[i].face = "";
                            > theFonts[i].size = "";
                            > }
                            >
                            > theFonts[i].color = "blue";
                            > }
                            > // Zap in an id
                            > // Please note the first cell in the table
                            > // is row1cell1.
                            > theIds =
                            > rows[rowsLoop].getElementsByT agName("td");
                            > for (var j = 0; j<theIds.length ; j++)
                            > {
                            > theIds[j].id = "row" + ( rowsLoop + 1 ) +
                            > "cell" + ( j + 1) ;
                            >
                            > }
                            >
                            > } // end of loop on rows
                            >
                            > // Display the table
                            > if (t.style)
                            > { t.style.visibil ity = "visible"; }
                            > else
                            > {
                            > alert("Oh, we have a table to display, " +
                            > "but we cannot.");
                            > }
                            > }
                            >
                            > }
                            > </script>
                            > </head>
                            >
                            > <body id="documentbod y" onload="adjust( );">
                            > <p>We will change this table after the page loads.</p>
                            > <center>
                            > <table id="mytable" cellpadding=3 cellspacing=0>
                            > <TR>
                            > <TD nowrap ALIGN="left">
                            > <FONT FACE="Arial"
                            > SIZE=3><IMG
                            > SRC="http://spaceplace.nasa .gov/en/educators/images/solarsystem/idadactyl_T.jpg "
                            > weight="10px"
                            > height="10px"> Net Trade Working Capital</FONT></TD>
                            > <TD ALIGN="right">
                            > <FONT FACE="Arial"
                            > SIZE=3
                            > color="red">147 ,345.00</FONT></TD>
                            > <TD ALIGN="right">
                            > <FONT FACE="Arial"
                            > SIZE=3>70,111.0 0</FONT></TD>
                            > <TD ALIGN="right">
                            > <FONT FACE="Arial"
                            > SIZE=3>110.16</FONT></TD>
                            > <TD>&nbsp;</TD>
                            > <TD>&nbsp;</TD>
                            > </TR>
                            > <TR>
                            > <TD nowrap ALIGN="left">
                            > <FONT FACE="Arial"
                            > SIZE=3><IMG
                            > SRC="http://spaceplace.nasa .gov/en/educators/images/solarsystem/idadactyl_T.jpg "
                            > weight="10px"
                            > height="10px"> Net Trade Reserve Capital</FONT></TD>
                            > <TD ALIGN="right">
                            > <FONT FACE="Arial"
                            > SIZE=3>7,345.00 </FONT></TD>
                            > <TD ALIGN="right">
                            > <FONT FACE="Arial"
                            > SIZE=3
                            > color="red">7,1 11.00</FONT></TD>
                            > <TD ALIGN="right">
                            > <FONT FACE="Arial"
                            > SIZE=3>11.16</FONT></TD>
                            > <TD>&nbsp;</TD>
                            > <TD>&nbsp;</TD>
                            > </TR>
                            > </table>
                            > </center>
                            > </body>
                            >
                            > </html>[/color]

                            Comment

                            • Andrew Thompson

                              #15
                              Re: Taking Control of a table?

                              On 5 Oct 2004 06:12:02 -0700, Craig wrote:
                              [color=blue]
                              > Robert thanks very much for the code.[/color]

                              I'm glad Robert got some code for you that does the job. :-)

                              As the person who commented "so it might pay to copy/paste
                              a little of the text in your reply.", I feel obliged to point
                              out that I did not mean to quote the *entire* post!

                              The idea is to quote just enough so that the reader can get
                              the basic idea of what you are replying to, then trim the rest.

                              My apologies for any confusion.

                              --
                              Andrew Thompson
                              http://www.PhySci.org/codes/ Web & IT Help
                              http://www.PhySci.org/ Open-source software suite
                              http://www.1point1C.org/ Science & Technology
                              http://www.lensescapes.com/ Images that escape the mundane

                              Comment

                              Working...