Change table color every day, not happy with Word

Discussion in 'HTML' started by Christopher M., Sep 17, 2005.

  1. I didn't want to have to learn Frontpage, so I've been using Microsoft Word
    to edit HTML files.

    I'm using Word 2000, but I'm having a problem. There's a script in my HTML
    file that creates a starting TABLE tag. But when I make changes to my HTML
    file Word doesn't run the script for the starting TABLE tag, so it gets rid
    of the ending TABLE tag.

    Here's code for changing the color of your favorite table every day:
    <SCRIPT language="JavaScript">

    now = new Date()
    var dToday = now.getDay()

    switch (dToday)
    {
    // using the 'background' property of the style property to set the
    color
    // 'bgcolor' property has no effect in this case

    // Sunday: Light blue
    case 0: document.write('<table border=1 cellspacing=0 cellpadding=0
    bgcolor=\"#ffffff\"
    style=\'background:#0099FF;border-collapse:collapse;border:none;mso-border-a
    lt:solid windowtext .5pt;mso-padding-alt:0in 5.4pt 0in 5.4pt\'>'); break
    // Monday: Green
    case 1: document.write('<table border=1 cellspacing=0 cellpadding=0
    bgcolor=\"#ffffff\"
    style=\'background:#00FF00;border-collapse:collapse;border:none;mso-border-a
    lt:solid windowtext .5pt;mso-padding-alt:0in 5.4pt 0in 5.4pt\'>'); break
    // Tuesday: Blue-Green
    case 2: document.write('<table border=1 cellspacing=0 cellpadding=0
    bgcolor=\"#ffffff\"
    style=\'background:#00FFFF;border-collapse:collapse;border:none;mso-border-a
    lt:solid windowtext .5pt;mso-padding-alt:0in 5.4pt 0in 5.4pt\'>'); break
    // Wednesday: Off-Red
    case 3: document.write('<table border=1 cellspacing=0 cellpadding=0
    bgcolor=\"#ffffff\"
    style=\'background:#FF6666;border-collapse:collapse;border:none;mso-border-a
    lt:solid windowtext .5pt;mso-padding-alt:0in 5.4pt 0in 5.4pt\'>'); break
    // Thursday: Red + Blue
    case 4: document.write('<table border=1 cellspacing=0 cellpadding=0
    bgcolor=\"#ffffff\"
    style=\'background:#FF00FF;border-collapse:collapse;border:none;mso-border-a
    lt:solid windowtext .5pt;mso-padding-alt:0in 5.4pt 0in 5.4pt\'>'); break
    // Friday: Yellow
    case 5: document.write('<table border=1 cellspacing=0 cellpadding=0
    bgcolor=\"#ffffff\"
    style=\'background:#FFFF00;border-collapse:collapse;border:none;mso-border-a
    lt:solid windowtext .5pt;mso-padding-alt:0in 5.4pt 0in 5.4pt\'>'); break
    // Saturday: Beige
    case 6: document.write('<table border=1 cellspacing=0 cellpadding=0
    bgcolor=\"#ffffff\"
    style=\'background:#FFCC99;border-collapse:collapse;border:none;mso-border-a
    lt:solid windowtext .5pt;mso-padding-alt:0in 5.4pt 0in 5.4pt\'>'); break
    // Default (in case of error): Beige
    default: document.write('<table border=1 cellspacing=0 cellpadding=0
    bgcolor=\"#ffffff\"
    style=\'background:#FFCC99;border-collapse:collapse;border:none;mso-border-a
    lt:solid windowtext .5pt;mso-padding-alt:0in 5.4pt 0in 5.4pt\'>');
    }

    //code for changing other color properties
    //document.bgColor = 'red'
    //document.fgColor = 'black'
    //document.linkColor = 'blue'

    </SCRIPT>

    <!commented out the starting tag for the table--generating this above with
    Javascript-->

    <!--<table border=1 cellspacing=0 cellpadding=0 bgcolor="#ffcc99"
    style='background:
    #FFCC99;border-collapse:collapse;border:none;mso-border-alt:solid
    windowtext .5pt;
    mso-padding-alt:0in 5.4pt 0in 5.4pt'>-->


    Christopher M.
     
    Christopher M., Sep 17, 2005
    #1
    1. Advertising

  2. On Sat, 17 Sep 2005 07:11:40 +0200, Christopher M.
    <> wrote:

    > I didn't want to have to learn Frontpage, so I've been using Microsoft
    > Word to edit HTML files.


    Well, if you're comfortable with that, fine. But don't expect people who
    take markup a lot more serious to take you by the hand and help you step
    by step through that bloated mess you think is suitable for the world wide
    web.

    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
     
    Barbara de Zoete, Sep 17, 2005
    #2
    1. Advertising

  3. Christopher M.

    Toby Inkster Guest

    Christopher M. wrote:

    > I didn't want to have to learn Frontpage, so I've been using Microsoft
    > Word to edit HTML files.


    Please don't use either.

    http://www.nvu.com/

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Now Playing ~ ./matchbox_twenty/mad_season_by_matchbox_twenty/10_bed_of_lies.ogg
     
    Toby Inkster, Sep 17, 2005
    #3
  4. On Sat, 17 Sep 2005 05:11:40 +0000, Christopher M. wrote:

    > I didn't want to have to learn Frontpage, so I've been using Microsoft Word
    > to edit HTML files.


    Below is a link to an easy to follow html tutorial. Learn what is in there
    and you'll be producing webpages by hand in notepad faster than any html
    bloat generator and it will load faster and be easier to read and debug.

    http://www.yourhtmlsource.com/

    Failing that, use nvu, mozilla composer or install Linux and use
    Quanta+(my fave).

    --
    Jafar Calley
    Producer - http://moonlife-records.com
    --------------------------------------
    See the latest Mars and Saturn images
    http://fatcat.homelinux.org
     
    Jafar As-Sadiq Calley, Sep 17, 2005
    #4
  5. On Sat, 17 Sep 2005, Jafar As-Sadiq Calley wrote:

    > Below is a link to an easy to follow html tutorial.

    [...]
    > http://www.yourhtmlsource.com/


    There's nothing like starting on the wrong foot. It's always so much
    harder and time-consuming to un-learn afterwards, if one ever gets serious
    about web authoring.

    Clue: HTML isn't a visual design language, but a structured markup. Not a
    very powerful structure, it's true, but it's still structure. The
    stylesheet is meant to look after the visual side of things.

    I wish I knew a /good/ beginner tutorial to recommend to folks. This, I'm
    afraid, isn't it.

    And it refused to fit in my regular browser window - insisting on
    throwing a left-right scrollbar, which is rude.
     
    Alan J. Flavell, Sep 17, 2005
    #5
  6. Christopher M.

    Paul Watt Guest

    "Alan J. Flavell" <> wrote in message
    news:pine.WNT.4.63.0509171708420.300@ZORIN...
    >
    > On Sat, 17 Sep 2005, Jafar As-Sadiq Calley wrote:
    >
    >> Below is a link to an easy to follow html tutorial.

    > [...]
    >> http://www.yourhtmlsource.com/

    >
    > There's nothing like starting on the wrong foot. It's always so much
    > harder and time-consuming to un-learn afterwards, if one ever gets serious
    > about web authoring.
    >
    > Clue: HTML isn't a visual design language, but a structured markup. Not a
    > very powerful structure, it's true, but it's still structure. The
    > stylesheet is meant to look after the visual side of things.
    >
    > I wish I knew a /good/ beginner tutorial to recommend to folks. This, I'm
    > afraid, isn't it.
    >
    > And it refused to fit in my regular browser window - insisting on
    > throwing a left-right scrollbar, which is rude.


    Hi,
    Try http://webmonkey.wired.com/webmonkey/ . Theres some great tutorials and
    lots of stuff to get you started the right way. All you need is notepad and
    a bit of patience.

    HTH
    Paul
     
    Paul Watt, Sep 17, 2005
    #6
  7. Christopher M.

    Dan Guest

    Christopher M. wrote:
    > I didn't want to have to learn Frontpage, so I've been using Microsoft Word
    > to edit HTML files.


    I didn't want to have to eat horse shit, so I've been eating chicken
    shit. (Clue: There actually *are* alternatives for creating HTML other
    than Frontpage and Word, and most of them are better than these pieces
    of excrement.)

    > I'm using Word 2000, but I'm having a problem. There's a script in my HTML
    > file that creates a starting TABLE tag. But when I make changes to my HTML
    > file Word doesn't run the script for the starting TABLE tag, so it gets rid
    > of the ending TABLE tag.


    For a rare change, Word is actually behaving in a quasi-sensible
    manner; you're giving it invalid HTML code, so it's trying to fix it
    into... well, I won't actually say "valid code", since nothing excreted
    from Word has ever validated as far as I'm aware, but it's trying to
    fix your error anyway. The code is supposed to be properly structured
    and nested *prior to* the execution of any client-side scripting that
    may be within it, as well as subsequent to any effects of such editing.
    After all, a user may choose to disable JavaScript altogether. Thus,
    if you want (for some reason) to output the opening tag of a table via
    JavaScript, you ought to output the *entire* table by JavaScript, so
    there won't be parts of it present without other parts if the script is
    not run.

    --
    Dan
     
    Dan, Sep 17, 2005
    #7
  8. Christopher M.

    kchayka Guest

    Paul Watt wrote:

    > "Alan J. Flavell" <> wrote in message
    > news:pine.WNT.4.63.0509171708420.300@ZORIN...
    >>
    >> I wish I knew a /good/ beginner tutorial to recommend to folks.

    >
    > Try http://webmonkey.wired.com/webmonkey/


    Due to their poor choices of both font-size and colors, this is totally
    unreadable unless I zoom text to some huge number. Nothing like starting
    out on the wrong foot... :(

    --
    Reply email address is a bottomless spam bucket.
    Please reply to the group so everyone can share.
     
    kchayka, Sep 19, 2005
    #8
    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. Whitecrest

    Happy Turkey Day

    Whitecrest, Nov 27, 2003, in forum: HTML
    Replies:
    7
    Views:
    423
    nice.guy.nige
    Nov 30, 2003
  2. Travis Newbury

    HAPPY MOTHERS DAY

    Travis Newbury, May 8, 2005, in forum: HTML
    Replies:
    8
    Views:
    466
    Adrienne
    May 10, 2005
  3. Andy
    Replies:
    1
    Views:
    765
  4. Travis Newbury

    HAPPY TURKEY DAY

    Travis Newbury, Nov 26, 2009, in forum: HTML
    Replies:
    18
    Views:
    927
    Travis Newbury
    Nov 28, 2009
  5. Daniel Martin
    Replies:
    1
    Views:
    190
    Daniel Martin
    Sep 6, 2006
Loading...

Share This Page