Welcome to our forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Forum Statistics

  • Forum Members:
  • Total Threads:
  • Total Posts: 4
There are 1 users currently browsing forums.
HTML/CSS Coding The basis of the World Wide Web, HTML, XHTML, and CSS make our forum possible, so it must be important right? Ask questions and receive help with these markups here.

Reply
  #1  
Old 12-06-2008
New Born
 
Join Date: Dec 2008
Posts: 2
Rep Power: 0
septrax is on a distinguished road
Trying to make table clickable

Hi

Im making my first website and i got stuck on one thing

Im trying to make a table with mouse over colour that also are are linked to different websites (forum in this case)

But the only thing i have done is


Its exact what i want exept there is no links and i just cant get them there to work without mess up everything else lol

Well here is the code i use

Code:
<html>
<head>
<title>Testing</title>
<style type="text/css">
td.off {
background: #CCCCCC;
}
td.on {
background: #999999;
}
</style>
</head>
<body>
<table width="150" cellpadding="3">
<tr>
<td class="off" onmouseover="this.className='on'"
onmouseout="this.className='off'"><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">Menu
1 </font></td>
</tr>
<tr>
<td class="off" onmouseover="this.className='on'"
onmouseout="this.className='off'"><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">Menu
2 </font></td>
</tr>
<tr>
<td class="off" onmouseover="this.className='on'"
onmouseout="this.className='off'"><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">Menu
3</font></td>
</tr>
<tr>
<td class="off" onmouseover="this.className='on'"
onmouseout="this.className='off'"><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">Menu
4 </font></td>
</tr>
</table>
</body>
</html>
Any suggestion ?
Reply With Quote
  #2  
Old 12-07-2008
Forever Young
 
Join Date: Nov 2008
Location: QC Area, IL
Posts: 42
Rep Power: 0
RpgFan is on a distinguished road
Re: Trying to make table clickable

Is there any reason for you to disregard the :hover pseudo-class? Consider this CSS:
Code:
table.hover_table a {
  color:#000;
  background-color:#CCC;
  font:Verdana,Arial,Helvetica,sans-serif 10px
}

table.hover_table a:hover {
  background-color:#999;
  text-decoration:none /* When you normally hover over a
                          link, you get an underline.  It
                          appears that you don't want that. */
}
with this HTML:
Code:
<table class="hover_table" width="150" cellpadding="3">
  <tr>
    <td><a href="menu1.html">Menu 1</a></td>
  </tr>
  <tr>
    <td><a href="menu2.html">Menu 2</a></td>
  </tr>
  <tr>
    <td><a href="menu3.html">Menu 3</a></td>
  </tr>
  <tr>
    <td><a href="menu4.html">Menu 4</a></td>
  </tr>
</table>
Does that do what you're wanting (except the links, of course... You'll need to link them to your pages, not made-up ones. )?
Reply With Quote
  #3  
Old 12-08-2008
New Born
 
Join Date: Dec 2008
Posts: 2
Rep Power: 0
septrax is on a distinguished road
Re: Trying to make table clickable

Quote:
RpgFan originally posted: View Post
Is there any reason for you to disregard the :hover pseudo-class? Consider this CSS:
Code:
table.hover_table a {
  color:#000;
  background-color:#CCC;
  font:Verdana,Arial,Helvetica,sans-serif 10px
}

table.hover_table a:hover {
  background-color:#999;
  text-decoration:none /* When you normally hover over a
                          link, you get an underline.  It
                          appears that you don't want that. */
}
with this HTML:
Code:
<table class="hover_table" width="150" cellpadding="3">
  <tr>
    <td><a href="menu1.html">Menu 1</a></td>
  </tr>
  <tr>
    <td><a href="menu2.html">Menu 2</a></td>
  </tr>
  <tr>
    <td><a href="menu3.html">Menu 3</a></td>
  </tr>
  <tr>
    <td><a href="menu4.html">Menu 4</a></td>
  </tr>
</table>
Does that do what you're wanting (except the links, of course... You'll need to link them to your pages, not made-up ones. )?

Nah i just added cursor: pointer; to a certain spot and now it does what i want :P not css its html
Reply With Quote
  #4  
Old 12-08-2008
Forever Young
 
Join Date: Nov 2008
Location: QC Area, IL
Posts: 42
Rep Power: 0
RpgFan is on a distinguished road
Re: Trying to make table clickable

Oh, I didn't realize you just wanted to change the cursor. Your topic and description said that you wanted to make things clickable, but your links weren't behaving the way you wanted them to.

Glad you got it sorted!
Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make a table automatically fit the space? lol <? Ashley ?> HTML/CSS Coding 14 10-12-2006 09:36 AM
PHP MySQL Tutorial Vio-Bear PHP Articles 3 02-21-2006 09:55 PM