Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table row as one big link ? 1

Status
Not open for further replies.

ghorr

Programmer
Sep 16, 2002
29
RO
I need one table row with more table cells to act as one big link ...
What i actually need is for the entire row to highlight when i have the mouse over any of the cells , and the link to be the same for all the cells in the row
 
How about this?
Code:
<table>
 <tr onClick=&quot;document.location = '[URL unfurl="true"]http://www.google.com'&quot;[/URL] style=&quot;cursor: pointer;&quot; onmouseover=&quot;this.bgColor='#CCCCCC'&quot; onmouseout=&quot;this.bgColor='#FFFFFF'&quot;>
  <td> Text1 </td>
  <td> Text2 </td>
  <td> Text3 </td>
 </tr>
</table>

Hope it helps.
 
heh ... can you please tell me possible values for cursor and how can i change the color of the text (not the bg color)?
thanx a lot
 
Well, if you want to change many outlooks of the row, you should rather go with classes:

<tr class=&quot;normal&quot; onClick=&quot;document.location = ' style=&quot;cursor: pointer;&quot; onmouseover=&quot;this.className='hilite'&quot; onmouseout=&quot;this.className='normal'&quot;>

and add classes in the styles in the head (or separate CSS file):
Code:
<style>
.normal {
	color: black;
	background: white;
}
.hilite {
	color: blue;
	text-decoration: underline;
	font-weight: bold;
	background: #CCCCCC;
}
</style>
You can add your own URL for cursor, as for which are available, consult:

 
To be on the safe side, you should make the text in the table cells into conventional <a href=&quot;...&quot;> links as well, so it still works for people (and search engine spiders) who have Javascript switched off. You can use CSS to turn off the standard link colouring and underline if you want to.

-- Chris Hunt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top