Jump to content

help linking rows in a table and


Recommended Posts

i`m using dreamweaver and relatively new at website building.

What i am doing is building a website to host dll`s, i have the dll`s listed in a table;

Like This

Is it possible to link the whole row instead of just the text and i would like to have each row change colour on mouseover.

If you know of a guide that will teach me this or you can walk me through it that would be a big help.

Link to comment
Share on other sites


  • 1 month later...

you have the guide right in your link. Look at the source code of that page and see how they are using mouseover and mouseout on table row bgcolor

USE THE FORCE... CHECK THE SOURCE!

<TR bgColor=#eef1f6 onmouseover="this.bgColor='#FFFFFF';"onmouseout="this.bgColor='#eef1f6';">

Edited by dman
Link to comment
Share on other sites

thats beautiful dman, thanx for spellin it out i`m just a point and click novice at the moment. :)

tell me, is it possible to link a whole row?

Edited by Neanderthal
Link to comment
Share on other sites

We are all novice when youconsider how much there is to know. The code in the sample page works ok. Just try to work your way through the source. save it on your local webserver so you can run it, then hack it apart piece by piece until you break it. That is when you found important part. This seems to work ok.

<table>
<tr bgColor=#eef1f6 onmouseover="this.bgColor='#AAAAAA';" onmouseout="this.bgColor='#FFFFFF';">
 <TD>Column 1</TD><TD>Column 2</TD><TD>Column 3</TD><TD>Column 4</TD>
</tr>
</table>

Link to comment
Share on other sites

ye i figured out how to change the row colour onmouseover but i want to link the whole row (not just the text) to a file.

Here is a sneak preview of the page.

FreeDLL

Notice just the file name is a link, i want the whole row to be a link.

I hope you understand this is frustrating me i can`t get it to work.

Link to comment
Share on other sites

This will turn row into link, add it to your <tr>. you will have to change the mouse pointer to finger onmouseover or with CSS style="cursor: pointer ;" if you want that too.

<html>
<head>
<style type="text/css">
<!--
tr {
cursor: pointer;
}
-->
</style>
</head>
<body>
<table>
  <tr onclick="document.location.href='http://www.mysite/myfile.xyz''"
   bgColor=#eef1f6 onmouseover="this.bgColor='#AAAAAA';" onmouseout="this.bgColor='#eef1f6';">
      <TD>Column 1</TD><TD>Column 2</TD><TD>Column 3</TD><TD>Column 4</TD>
  </tr>
</table>
</body>
</html>

You could also make a ".mousein" and ".mouseout" class in css for the color and background and set onmouseover and onmouseout to the class.

<style type="text/css">
.mousein {
background: #eef1f6;
color: #AAAAAA;
}

.mouseout {
background: #AAAAAA;
color: #eef1f6;
}
</style>
<td onmouseover="this.className='mousein';" onmouseout="this.className='mouseout';">

[edit:] Better yet, just skip all the mouseover/mouseout and use css "hover" (oops, this only works in FF and opera. IE CSS support sucks!)

tr {
cursor: pointer;
background: #eef1f6;
}
tr:hover {
background: #AAAAAA;
}
<tr onclick="document.location.href='http://www.mysite/myfile.RAR'" >
     <TD>Column 1</TD><TD>Column 2</TD><TD>Column 3</TD><TD>Column 4</TD>
 </tr>

BTW, Your site looks like a great resource! :thumbup

Edited by dman
Link to comment
Share on other sites

Wow, I must say a big thank you dman, you have been a big help. Decided to go with;

<tr bgcolor="#0099FF" onclick="document.location.href='File.RAR'" style="cursor: pointer;" onmouseover="this.bgColor='#00CCFF';"onmouseout="this.bgColor='#0099FF';">

IE complains about active content but what can you do, ppl will have to allow active content or click the firefox link thats going to be on every page instead. :D

Edited by Neanderthal
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...