Computing.Net > Forums > Web Development > Highlight table row without table?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Highlight table row without table?

Reply to Message Icon

Name: jb60606
Date: July 26, 2007 at 08:36:14 Pacific
OS: I don't know
CPU/Ram: Why are you asking me thi
Product: It's web development
Comment:

I know how to use JavaScript to highlight table rows.

In a static table, for example, some data may look like this.

<table>
<tr onMouseOver="this.bgColor='#E8E8E8';" onMouseOut="this.bgColor='#FFFFFF';">
<td>DATA1</td><td>DATA2</td>
</tr>
<tr onMouseOver="this.bgColor='#E8E8E8';" onMouseOut="this.bgColor='#FFFFFF';">>
<td>DATA1</td><td>DATA2</td>
</tr>
</table>

However, I have an AJAX script that outputs rows from a database within <DIV> tags, formatted by CSS classes, to give the appearance of a table instead of an actual table.

Does anyone know if it's possible to apply some kind of highlight script to <DIV> tags?

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: jb60606
Date: July 26, 2007 at 08:41:51 Pacific
Reply:

Or any method of highlighting,

...because I really don't know how I would adjust script to output to a table, instead of DIV tags.


0

Response Number 2
Name: Laler
Date: July 29, 2007 at 12:27:51 Pacific
Reply:

Actually you just have to put the onmouseover and onmouseout on the desired DIVs (the DIV that act as the row), assuming if that DIV's background color change will really change the output (ie: the DIVs inside that DIV, has no background colors).

Let's see:

<div onmouseover="changecolor(this)" class="rows">
<div class="cells">1.</div>
<div class="cells">Row 1</div>
</div>
<div onmouseover="changecolor(this)" class="rows">
<div class="cells">2.</div>
<div class="cells">Row 2</div>
</div>

As long as class "cells" does not have background colors, changing the background color of class "rows" with onmouseover will change the whole "row's" color.

---
Fubar


0

Response Number 3
Name: jb60606
Date: August 3, 2007 at 11:21:57 Pacific
Reply:

Thanks Laler, that did the trick.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Highlight table row without table?

Table rows with ID www.computing.net/answers/webdevel/table-rows-with-id/1872.html

question on HTML tables www.computing.net/answers/webdevel/question-on-html-tables/1652.html

Table Column Width Problem www.computing.net/answers/webdevel/table-column-width-problem/2865.html