Problem: Altering cell content in a <TABLE> on demand

Discussion in 'HTML' started by edwin Boyette, Sep 4, 2003.

  1. I would like to be able to set the content of a cell " <TD> <TD> " = to a
    variable, most likely store the data or content in an array, and then write
    the data in reponse to an action. Any thoughts on this I have been poking
    around all over the place and couldn't find a solution.
    edwin Boyette, Sep 4, 2003
    #1
    1. Advertising

  2. edwin Boyette <> wrote:
    > I would like to be able to set the content of a cell " <TD> <TD> " =
    > to a variable, most likely store the data or content in an array, and
    > then write the data in reponse to an action. Any thoughts on this I
    > have been poking around all over the place and couldn't find a
    > solution.


    HTML isn't a programming language, so look into one instead (I highly
    recomend PHP).
    --
    Michael Wilcox
    Essential Tools for the Web Developer - http://mikewilcox.t35.com
    mjwilco at yahoo dot com
    Michael Wilcox, Sep 4, 2003
    #2
    1. Advertising

  3. Michael Wilcox, Sep 5, 2003
    #3
  4. edwin Boyette

    Bagbourne Guest

    Michael Wilcox wrote:
    > edwin Boyette <> wrote:
    >
    >>Thanks Michael I'll have a look then. Is there any site you think
    >>that stands out with regards to tutorials and examples for PHP?

    >
    >
    > Learn the bare basics at www.php.net or www.phpfreaks.com (which has much
    > more advanced articles as well) and one at
    > http://hotwired.lycos.com/webmonkey/01/48/index2a.html?tw=programming (which
    > I haven't tried).


    edwin, they are all taking about server-side modification of the page. A
    reload of the page. You can't have poked around much to miss Javascript!

    You can use Javascript manipulation of the document to achieve the same
    thing within the client browser without reloading the page - provided
    that your user has a javascript enabled browser. It depends on the
    environment that your users have.

    Have a look at http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929
    appendinx D, "ECMA Script Language Binding". (ECMA script being the
    standardized version which most Javascript adheres to)

    You can access all elements of the document.

    <td id="mycell">
    ....
    <script type="text/javascript">
    var cell = document.getElementById("mycell");
    .....
    </script>

    Remove all child nodes from the cell, and add the ones you want.

    To create a text node to append to the cell, use
    document.createTextNode("hello world");

    For more help on this, take it to comp.lang.javascript.

    Nige
    Bagbourne, Sep 6, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Heckart
    Replies:
    6
    Views:
    531
    Rob Heckart
    Nov 26, 2003
  2. Phillip Roncoroni
    Replies:
    14
    Views:
    1,072
    Toby A Inkster
    Apr 5, 2004
  3. harry
    Replies:
    4
    Views:
    7,979
    Steve Pugh
    Jun 17, 2004
  4. Mel
    Replies:
    2
    Views:
    609
    Neredbojias
    Nov 29, 2005
  5. David McDivitt

    rewrite table cell content

    David McDivitt, Jun 14, 2006, in forum: HTML
    Replies:
    2
    Views:
    498
    David McDivitt
    Jun 14, 2006
Loading...

Share This Page