473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Table column rollover, is it possible?

I have a table as such:
<table>
<tr>
<td>Col 1</td>
<td>Col 2</td>
</tr>
<tr class="bgGrey">
<td>Col1Row1</td>
<td>Col2Row1</td>
</tr>
<tr class="bgYellow">
<td>Col1Row2</td>
<td>Col2Row2</td>
</tr>
</table>
I'm trying to get the entire vertical column 'light up' when you roll
over them. So, if you roll over 'Col 1' column, the entire vertical of
that column 'lights up'. To complicate matter, the table has
alternating row color. Can someone throw a suggestion here?

Jul 21 '05 #1
2 6313
mi************@gmail.com wrote:
I have a table as such:
<table>
<tr>
<td>Col 1</td>
<td>Col 2</td>
</tr>
<tr class="bgGrey">
<td>Col1Row1</td>
<td>Col2Row1</td>
</tr>
<tr class="bgYellow">
<td>Col1Row2</td>
<td>Col2Row2</td>
</tr>
</table>
I'm trying to get the entire vertical column 'light up' when you roll
over them. So, if you roll over 'Col 1' column, the entire vertical of
that column 'lights up'. To complicate matter, the table has
alternating row color. Can someone throw a suggestion here?


You would have to do this with Javascript, as most browsers afaik does
not support :hover for any other element than A.

Something like this should work:

<tr onmouseover="this.className=bgYellowActive;"
onmouseout="this.className=bgYellow;">

Regards,
Sune Rievers
Jul 21 '05 #2
Sune Rievers:
mi************@gmail.com wrote:
I'm trying to get the entire vertical column 'light up' when you roll
over them.
You would have to do this with Javascript,


Indeed.
as most browsers afaik does not support :hover for any other element than A.
Most browser /installations/ maybe. Although that seems to be changing,
too. Slowly.

The convenient looking

col:hover>td {background: foo}

does not (or should not) work for plausible reasons, that have been
explained often enough.
<tr onmouseover="this.className=bgYellowActive;"
onmouseout="this.className=bgYellow;">


tr:hover>td {background: foo}

OTOH does work, although, I think, some browsers want "tr>td:hover" in
addition. Don't forget 'th' and maybe restrict to 'tbody'. Table rows
('tr'), however, are horizontal, not vertical as asked, that would be
columns ('col').

Ugly, inconvenient class names btw., but you are right about changing
classes and not using '.style', although your simple example allows only
one class name per element instance and of course wouldn't work with
'col' either. A real JavaScript solution required a more advanced
function, that would also had to take 'rowspan' and 'colspan' into
account. I'm currently not fluent in any path nor scripting language, so
take this pseudo, which roughly describes what has to be done:

for (any in elem.parent.sibling)
or
for (any in elem.parent.parent.children as uncle)
for (any in uncle as cousin)
if (this.hindex == elem.hindex) this.setClass('active')

Ask in <news:comp.lang.javascript> for further assistance.
Jul 21 '05 #3

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

Similar topics

5
by: Brian Angliss | last post by:
I'm relatively new to scripting in JavaScript, so I'm not too surprised I'm having difficulty scripting up an animation effect for my personal site. What I'm trying to do is the following: When...
1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
4
by: Leythos | last post by:
I've got several sites that I used DreamWeaver MX to add RollOver buttons to the pages, it also adds some javascript that pre-loads the images and does the mouse_over and such. In FireFox 1.0.1...
5
by: jedbob | last post by:
I used Adobe Imageready to build a simple rollover navigation bar, where the text will change color on a mouse over. The working example can be found at:...
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
3
by: Rob R. Ainscough | last post by:
Just curious why a VERY commonly used affect of rollover was NOT implemented in .NET 2.0 for web controls? Does anyone have a link to VB code that will show me how to build my own UserControl...
2
by: mix2plix | last post by:
ok.. been bangin by brains the past few days with this one and decided to seek you'z help. so here ya go. based on the code below and this concept.. how should i proceed? I have a table of 4...
1
by: Iain Wilson | last post by:
Hi all I have a simple 2 column page (see below) styled by CSS In column 1 there are a list of href's. What I want to do is to have an image displayed in column 2 in response to a href...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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...

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.