473,654 Members | 3,062 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 2076
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="backgrou nd:lime">
javascript in head :

onload = function() {
setInterval( function() {
var flsh = document.getEle mentById('flash y').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.getEle mentById('flash y').style;
flsh.background = flsh.background =''? 'yellow' : '';
}, 100);
} >

</HEAD>
<BODY>

<table>
<tr><td id="flashy" style="backgrou nd: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

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

Similar topics

1
4569
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 one myself, but I need some help to finish it. I use the getAttribute('rowIndex') to return the position of a row within the table and apply modulo 2 to return a 0 or 1 indicating an even or odd row number, from which I apply the alternating...
47
18876
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 (yet), 2) put a class on every other tr, or 3) use javascript to do the styling for you. Well, I've been playing the CSS expressions quite a bit lately and I've found a much simpler solution which works in IE5.5+, using "expressions". If
3
4744
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
2219
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 the default settings in my browser is 'don't print out the background colour' which is fine because this would use lots of ink, but my table cell colours anr not showing up. A idea is to replace the cell color with image, but I don't want to use
9
2686
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 perform updates. All the styles that are set are being followed by all templated columns with the exception for the update column. The update column does set the BackColor appropriately but when setting its ForeColor the LinkButton's color is blue and...
1
1310
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 dynamically creating rows and cells. However, I can't seem to get the blasted thing to stop alternating the background colors on every other row! I've tried setting the cell.BackColor property, but the value is just getting ignored! Also tried on...
5
3337
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 runat="server" attribute on tables, leading me to believe that this should be possible. Any ideas? I'm using C#. Thanks, -KF
14
2281
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 tables easier to read. I would like this to work by applying a CSS class to only the <table> element. Applying two different classes to alternate <trelements is undesirable, as then it would be impossible to add, delete, or sort table rows...
5
1466
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> <currency>
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8707
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8593
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7306
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.