Connecting Tech Pros Worldwide Forums | Help | Site Map

How can I set a different border color for a table row?

Paweł Gałecki
Guest
 
Posts: n/a
#1: Jul 20 '05
How can I set a different border color for a table row?
All I found in the MSDN for <TR> was:
Scripting object.borderColor [ = sColor ]
but it doesn't work for <TR> though it works for <TD>. I would like to
change color of the border of the entire row in a response to onMouseover
and onMouseout events.
Any ideas?

Evertjan.
Guest
 
Posts: n/a
#2: Jul 20 '05

re: How can I set a different border color for a table row?


Paweł Gałecki wrote on 15 feb 2004 in comp.lang.javascript:[color=blue]
> How can I set a different border color for a table row?
> All I found in the MSDN for <TR> was:
> Scripting object.borderColor [ = sColor ]
> but it doesn't work for <TR> though it works for <TD>. I[/color]
would like to[color=blue]
> change color of the border of the entire row in a response[/color]
to[color=blue]
> onMouseover and onMouseout events.[/color]

A <tr> has no border, but perhaps this is what you are
looking for:

<script>
function green(x) {x.className="green"}
function red(x) {x.className="red"}
</script>

<style>
table tr td {font-size:25pt;padding:10px;}
.red td {border:red 5px dotted;}
.green td {border:green 5px dashed;}
</style>

<table>
<tr class="red" onmouseover="green(this)" onmouseout="red
(this)">
<td>qwerty uiop</td><td>asdfg hjkl</td></tr>
<tr class="red" onmouseover="green(this)" onmouseout="red
(this)">
<td>qwerty uiop</td><td>asdfg hjkl</td></tr>
<tr class="red" onmouseover="green(this)" onmouseout="red
(this)">
<td>qwerty uiop</td><td>asdfg hjkl</td></tr>
<tr class="red" onmouseover="green(this)" onmouseout="red
(this)">
<td>qwerty uiop</td><td>asdfg hjkl</td></tr>
<tr class="red" onmouseover="green(this)" onmouseout="red
(this)">
<td>qwerty uiop</td><td>asdfg hjkl</td></tr>
<tr class="red" onmouseover="green(this)" onmouseout="red
(this)">
<td>qwerty uiop</td><td>asdfg hjkl</td></tr>
</table>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Paweł Gałecki
Guest
 
Posts: n/a
#3: Jul 20 '05

re: How can I set a different border color for a table row?


On 15 Feb 2004 12:15:58 GMT, Evertjan. wrote:

[color=blue]
> A <tr> has no border, but perhaps this is what you are
> looking for:[/color]
Exactly what I needed, thanx a lot ;)
Closed Thread