Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Change table color every day, not happy with Word

Reply
Thread Tools

Change table color every day, not happy with Word

 
 
Christopher M.
Guest
Posts: n/a
 
      09-17-2005
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.


 
Reply With Quote
 
 
 
 
Barbara de Zoete
Guest
Posts: n/a
 
      09-17-2005
On Sat, 17 Sep 2005 07:11:40 +0200, Christopher M.
<(E-Mail Removed)> 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 |
`-------------------------------------------------- --<--@ ------------'
 
Reply With Quote
 
 
 
 
Toby Inkster
Guest
Posts: n/a
 
      09-17-2005
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

 
Reply With Quote
 
Jafar As-Sadiq Calley
Guest
Posts: n/a
 
      09-17-2005
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

 
Reply With Quote
 
Alan J. Flavell
Guest
Posts: n/a
 
      09-17-2005

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.
 
Reply With Quote
 
Paul Watt
Guest
Posts: n/a
 
      09-17-2005

"Alan J. Flavell" <(E-Mail Removed)> wrote in message
newsine.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


 
Reply With Quote
 
Dan
Guest
Posts: n/a
 
      09-17-2005

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 ****, so I've been eating chicken
****. (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

 
Reply With Quote
 
kchayka
Guest
Posts: n/a
 
      09-18-2005
Paul Watt wrote:

> "Alan J. Flavell" <(E-Mail Removed)> wrote in message
> newsine.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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing font color from current font color to black color Kamaljeet Saini Ruby 0 02-13-2009 04:58 PM
HEXUS.opinions :: Have a happy happy gaming holiday Silverstrand Front Page News 0 12-23-2005 04:12 PM
Change text color for one document.write but not color of all text? kroger@princeton.edu Javascript 7 02-02-2005 01:23 PM
Happy Happy Joy Joy, I recovered my photos Tama Mativa Digital Photography 9 05-24-2004 04:58 PM
happy happy christmas showgun MCSE 26 12-17-2003 07:11 PM



Advertisments