By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,945 Members | 1,703 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,945 IT Pros & Developers. It's quick & easy.

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

P: n/a
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?
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Paweł Gałecki wrote on 15 feb 2004 in comp.lang.javascript:
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.


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)
Jul 20 '05 #2

P: n/a
On 15 Feb 2004 12:15:58 GMT, Evertjan. wrote:

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

Exactly what I needed, thanx a lot ;)
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.