473,503 Members | 1,657 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Alternating colours in a table cell

Is there any way to make table cell's bgColor alternate, simulating a
flashing effect?

Nov 7 '06 #1
13 2053
Trev wrote:
Is there any way to make table cell's bgColor alternate, simulating a
flashing effect?
Yes.

Richard.

Nov 7 '06 #2

Richard Cornford wrote:
Trev wrote:
Is there any way to make table cell's bgColor alternate, simulating a
flashing effect?

Yes.

Richard.
please elaborate!!!!

Nov 7 '06 #3
Trev wrote:
Richard Cornford wrote:
>Trev wrote:
>>Is there any way to make table cell's bgColor alternate, simulating a
flashing effect?

Yes.

Richard.

please elaborate!!!!
An ability to use scripts to apply specific background colors to
individual table cells implies an ability to alternate the colours
used, both sequentially and with time.

Richard.

Nov 7 '06 #4
ASM
Trev a écrit :
Is there any way to make table cell's bgColor alternate, simulating a
flashing effect?
Arrrghhh ! beurk !

<td id="flashy" style="background:lime">
javascript in head :

onload = function() {
setInterval( function() {
var flsh = document.getElementById('flashy').style;
flsh.background = flsh.background=''? 'yellow' : '';
}, 100);
}
Nov 7 '06 #5

Richard Cornford wrote:
Trev wrote:
Richard Cornford wrote:
Trev wrote:
Is there any way to make table cell's bgColor alternate, simulating a
flashing effect?

Yes.
>
Richard.
please elaborate!!!!

An ability to use scripts to apply specific background colors to
individual table cells implies an ability to alternate the colours
used, both sequentially and with time.

Richard.

Is there any way to implement this in Javascript, and if so, how?
I have tried using a while(true) loop using the <td>'s element name and
changing bgColor but the code has a malaise.

Nov 7 '06 #6
ASM
Richard Cornford a écrit :
Trev wrote:
>Richard Cornford wrote:
>>Trev wrote:
Is there any way to make table cell's bgColor alternate, simulating a
flashing effect?
Yes.

Richard.
please elaborate!!!!

An ability to use scripts to apply specific background colors to
individual table cells implies an ability to alternate the colours
used, both sequentially and with time.

Richard.
:-)

well seen !
Nov 7 '06 #7
Tried it...still some malaise.... :(

<HTML>
<HEAD onload = function() {
setInterval( function() {
var flsh = document.getElementById('flashy').style;
flsh.background = flsh.background=''? 'yellow' : '';
}, 100);
} >

</HEAD>
<BODY>

<table>
<tr><td id="flashy" style="background:lime">whizz</td><td>eggy
xt</td><td>bang</td></tr>
</table>

</BODY>
</HTML>

Nov 7 '06 #8
ASM
Trev a écrit :
Tried it...still some malaise.... :(
I said in *javascript* ! ...

(in header)

You don't know how to input a script code in a html file ?
Nov 7 '06 #9

ASM wrote:
Trev a écrit :
Tried it...still some malaise.... :(

I said in *javascript* ! ...

(in header)

You don't know how to input a script code in a html file ?

Damn, sorry, my mind slipped on a dog turd.

Nov 7 '06 #10

Trev wrote:
ASM wrote:
Trev a écrit :
Tried it...still some malaise.... :(
I said in *javascript* ! ...

(in header)

You don't know how to input a script code in a html file ?


Damn, sorry, my mind slipped on a dog turd.
By the way, why is onload in the head? Should it be in the body tag:
<body onLoad='function();'??

Nov 7 '06 #11
ASM
Trev a écrit :
Trev wrote:
>ASM wrote:
>>Trev a écrit :
Tried it...still some malaise.... :(
I said in *javascript* ! ...

Damn, sorry, my mind slipped on a dog turd.

By the way, why is onload in the head?
why not ?
Should it be in the body tag:
<body onLoad='function();'??
<body
onload="setInterval( function() {
var flsh = document.getElementById('flashy').style;
flsh.background = flsh.background=''? 'yellow' : '';
}, 100);">

not very clean
Nov 7 '06 #12
PL
Trev wrote:
Is there any way to make table cell's bgColor alternate, simulating a
flashing effect?

Hi Trev,
If you want some ideas, have a look at my webpage (see below).

Cheers

Paul
--
----
Home: http://www.paullee.com
Woes: http://www.dr_paul_lee.btinternet.co.uk/auto.shtml
Nov 7 '06 #13
PL said the following on 11/7/2006 3:25 PM:
Trev wrote:
>Is there any way to make table cell's bgColor alternate, simulating a
flashing effect?


Hi Trev,
If you want some ideas, have a look at my webpage (see below).
Before the page even loads:

Line: 638
Char: 1
Error: Access is Denied
Code: 0
URL: http://www.btinernet.com/~dr_paul_lee/

Not very convincing proof of an author's ability to write Javascript.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 7 '06 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4547
by: Alistair Birch | last post by:
Hi I want rows of a table to appear in alternating background colours. Having looked around the web I can't find any solution apart from waiting for the next version of CSS, so I tried building...
47
18844
by: Matt Kruse | last post by:
http://www.mattkruse.com/temp/css_expressions.html One of the standard CSS questions is "how can I shade every other table row a different color with CSS?" The answers are usually 1) you can't...
3
4737
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
1
2208
by: Amirallia | last post by:
Hello, If I want to print a page with a table with cells colored in differents colors, assuming default settings in browser, when I view the page, all the colours disappear. I know that one of...
9
2678
by: Max Weebler | last post by:
Hi, I have a datagrid built that has an alternating item style that sets the backcolor and ForeColor of its rows. I have 4 template columns. One of them has a LinkButton embedded in it to...
1
1299
by: Steve Bottoms | last post by:
Hi, all! How does one prevent table cell background colors from alternating between grey and white? I've dropped a basic table control on an ASP.Net page (using VB.Net codebehind), and...
5
3329
by: | last post by:
I'm making admin forms. I'm wondering if there is a way to have the server programmatically assign alternating colors in a regular table (not a datalist control). I notice ASP.NET 2 offers a...
14
2263
by: Tristan Miller | last post by:
Greetings. Is it possible with CSS to have an HTML <tablesuch that even-numbered <trrows have one background colour, and odd-numbered <trrows have another background colour? This makes wide...
5
1459
by: eric.goforth | last post by:
Hello, I have some xml data that look like: <currencysummary rec_count="16"> <currency> <currency_description>$</_currency_description> <currency_code>1</_currency_code> </currency>...
0
7198
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7271
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4998
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.