HTML - Table Cell Mouseover Color
Hi, I need some code that will make cells in a table change colour (yellow) with mouse over.
The problem is that i really need to avoid having to put the code in <TD> as there are about 5000 cells in total! and that will add alot of bytes to it. Needs to work in IE7 and firefox mainly. Any help would be great! Thanks Joe Similar TutorialsI am working on a site that I have designed using a table to lay everything out. Everything works fine when viewing via IE. I tried opening it with Firefox and the backround colors for the different cells did not show up. Can anyone tell me what I should do so that the bgcolor shows up correctly in firefox? temp web-site address: http://worldcargousa.com/estate_lawn part of the html in question: <td width="166" align="center" valign="middle" bgcolor="61592b"><p align="center" class="style9"><span class="style15">715-220-1879 </span></p> <p class="style13">Estate Lawn Services<br> 536 Gentalwood Square<br> Purcellville, VA 20132</p> <p align="left" class="style8"> </p></td> So I decided to see if I could make my site XHTML 1.0 Strict-compliant. Here's the main page on my test server I'd be thrilled with it if I could do 3 things: - Set the background color of the left column to match the color behind the fonts. Is there a CSS class I can create and set the cells to that class? - Remove the border around clickable images. - Get the spacing between the menu options on the left to look the way it does on the other pages in the site. If you click any of the pages on my actual site you can see the look I'm going for. Thanks as always for the help! Joshua Hi everyone: Any help appreciated. Objective: To have three equally sized and spaced images arranged horizontally, with their size set automatically by the size of the window. Development: I'm using a Mac, and I don't have ready access to a PC to experiment. What I tried: Code: <table> <tr> <td><img src = "a.png" style = "width: 100%" /></td> <td><img src = "b.png" style = "width: 100%" /></td> <td><img src = "c.png" style = "width: 100%" /></td> </tr> </table> <p class = "caption">A caption for the 3 images</p> <p class = "legend" >A legend for the three images</p> What happened: This works perfectly in Safari and Firefox (Mac) and Firefox under Vista, but in Internet Explorer under Vista , the images are HUGE - the unscaled size of the originals. What I think is the reason: IE is taking 100% to be relative to the width of the body element, not the td element. What I don't want to have to do: Use fixed sizes or calculate the sizes on the fly. What I'm trying now: removing the table and using a div, and inside that, setting the image width to 33% and floating one right and one left. What's the trick to get around this IE "gotcha" please? Thanks from a newbie. hi, i have a jsp page, in this page i am displaying data retrieved from mysql database. Now the problem is i must color table cell based on cell value. how to implement this.please give me an sample or working code foe this problem.( any code is accepted) preferably html or javascript. i.e if cell value is "late" then display that cell in red color else display the cell in green color please help me. Thanks ad Regards Akash I have this html code to make a button. This works OK. However I want to have a mouse over effect (text color change or back ground color change or ??) can someone add the correct code for that if it is possible to do. here is the code: ------ <p> <button style="height: 25px; width: 199px;color:black; background: lightblue; border="10"" onclick="window.location='http://www.cityofcarlton.com'"> <b>City of Carlton</b> </button> </p> ----------- I know of a way to do it with an embedded style tag in the <HEAD> section of your HTML page. <style type="text/css"> a:link {color:#000080; text-decoration: none;} a:visited {color:#946C6B; text-decoration: none;} a:hover {color:#FF0000; text-decoration: none;} a:active {color: #B70004; text-decoration: none;} </style> However I want it done within the button code itself. And I do not want to use css Thanks I have a table with cells in the middle. I set my border="0". and I still see a white outline. My background has a color and I see white where my cells are. So I used the bordercolor=" " command, but still see white no matter what color I pick. Code: <table width="1500" border="0" > <tr> <td colspan="2" align="center" bgcolor="#FF9966" ><img src="images/banner.gif" width="800" height="210" alt="banner" /></td> </tr> <tr> <td width="183" align="center" bgcolor="#FF9966">Home</td> <td width="1305" rowspan="7" bgcolor="#FF9966"> </td> </tr> Hello Im creating a IE Mobile website, which has limited CSS capabilities ( see http://blogs.msdn.com/windowsmobile/...es/213771.aspx ) and jscript capabilities( http://msdn.microsoft.com/library/de...ects2_jrzu.asp ) I have been able to change the buttons color and my current version I have the following code that changes the page background color when a button is focused. I just want the buttons to change color when the focus is on it and when no longer focused goes back to normal, so the user knows they have moved to another button. <HEAD><title>MySite</title> <SCRIPT TYPE="text/javascript"> <!-- function setbg(color) { document.bgColor=color; document.body.style.backgroundColor=color; } //--> </SCRIPT> </HEAD> <BODY> <INPUT TYPE="BUTTON" NAME="Btn1" VALUE="1" onFocus="setbg('red')" > <INPUT TYPE="BUTTON" NAME="Btn1" VALUE="1" onFocus="setbg('black')" > </BODY> </HTML> Any suggestion on how to change just button color upon mouseover and mouseout? Well thanks for any help 1 can extend! Okay. I'm trying to make it so when you mouseover a players "avatar" the border color changes from grey to red. The following code works PERFECT in IE, but FF, the border doesn't show up at all. CSS Coding: Code: img.avatar { border-color : #CCCCCC; border : 1px } img.avatar:hover { border-color : #ff0000; border : 1px } img.avatar:visited { border-color : #CCCCCC; border : 1px } img.avatar:hover { border-color : #ff0000; border : 1px } HTML Coding: Code: <TD align=middle width=104> <DIV align=center><A href="Link"><IMG class=avatar height=75 alt="" src="Image URL" width=75></A></DIV></TD> The table itself is working fine, but the size of each cell is not correct in Firefox. Here is a screenshot of what is happening: http://img35.imageshack.us/img35/1938/tabletroubles.gif Here is the head of my page, the css for the table is he HTML Code: <style type="text/css"> #cat table {border:0px solid #333333; cell-padding:0; cell-spacing:0; align=center} #cat tr {align=center} #cat td {font-size: 13px; font-family=tahoma; font-weight: bold; padding: 0px; border:0px solid #333333; align=center;} #cat td a {text-decoration: none; color:#757575; background-color: white; display:block; height=23; background-image: url(linkbg1.gif); align=center;} #cat td a:hover {background-color: #333333; font-weight: bold; text-decoration: none;color: #ffffff; background-image: url(linkbg2.gif); align=center;} </style> and here is the table code, located in the body of the page: HTML Code: <div style="Height:53px; overflow:auto; width:900px; position:absolute; top:0; left:0"> <TABLE bgcolor=#333333 cellspacing=0; cellpadding=0;><tr><td> <div id="cat"> <table width=900; cellpadding:0px; cellspacing:0px> <tr align=center> <td width=20%> <font face=tahoma><a href="home.html">Home</a></font> </td> <td width=20%><center><font face=tahoma><a href="openings.html" target="_top">Openings</a></font></center></td> <td width=20%><center><font face=tahoma><a href="dance.html" target="_top">Dance</a></font></center></td> <td width=20%><center><font face=tahoma><a href="projects.html" target="_top">Projects</a></font></center></td> <td width=20%><center><font face=tahoma><a href="vocaloid.html" target="_top">Vocaloid</a></font></center></td> </tr> <tr> <td width=20%><center><font face=tahoma><a href="fanflashes.html" target="_top">Fanflashes</a></font></center></td> <td width=20%><center><font face=tahoma><a href="caramelldansen.html" target="_top">Caramelldansen</a></font></center></td> <td width=20%><center><font face=tahoma><a href="cosplay.html" target="_top">Cosplay</a></font></center></td> <td width=20%><center><font face=tahoma><a href="endings.html" target="_top">Endings</a></center></td> <td width=20%><center><font face=tahoma><a href="anime.html" target="_top">Anime Episodes</a></font></font></center></td> </tr> </table> </div> </td></tr></table> </div> A table is nested within another table. The table on the outside has no content, it is there to make a gray border around everything else. If you look at the table in firefox & internet explorer, you'll see that in IE- the table is much thicker than in firefox. How can i make it so that the table in Firefox will have the same thickness as the one in IE? I could really use some help. Thanks! Hi, just wondering how I can code a table which changes on a mouseover, like on this website? Tried looking at their source, but I can't seem to get the right bit! Cheers for any help Joe I am creating a website that has a search button with an image. I would like to know if there is some simple code that I can include that would display the same basic image with a different color when the user mouses over the button. Here is the code: <FORM name="searchform" onSubmit="return validateSearch();" METHOD="POST" ACTION="search_results_lt.asp"> <INPUT TYPE="text" NAME="Search" VALUE="" SIZE="20" > <INPUT TYPE=IMAGE SRC="images/search_button.gif" Name="SearchButton" Value="Submit"> </FORM> **** Thanks for your help, Robin For some reason in my website, my table moves over when you mouseover it. I do not have a mouseover code activated for that. So I don't know why it is happening. Here is a link to the page that it happens on: http://white-candle.net/Business.html It is the box right above the form. Here is the code for my table: Code: <table width="327" border="6" cellpadding="1" class="text" style="line-height:12px "> <tr> <td><CENTER><p>If you are interested in joining a team that is dedicated to helping you succeed, please fill out the form below!</p> <p>You will receive for free, a few scent samples, a brochure with the product price list, a business card, an informative mp3 pack, and a getting started PDF.</p></CENTER></td> </tr> </table> I'm using dreamweaver if that matters. Hi everyone. So I got my template set up to the way I like it and everything is rolling good. I inserted a picture into one of the cells in the table and it shifts everything over. Here is my code: <td width="625" colspan="1" bgcolor="white"> <font type="Arial" size ="5" color="blue"> <b>Floorplan</b><br> <center> <a href="floorplanlarge.jpg"><img src="floorplansmall.jpg" border="0" /></a> </center> </td> I have been working on fixing this for the last hour and am out of ideas on what is going on. The picture is smaller than the cell width range. My picture width is 311 pixels and the cell width is 625 pixels. I dont know if there is code whether its HTML or CSS to prevent the cell from widening. Any help would be appreciated. Also if you need me to provide more detail I can. Thanks. Hello, I have a problem with tables cells containing form buttons: Code: <tr> <td colspan="2" align="center"> <button id="button-submit_2" type="submit">Add Name</button>      </form> <form action="nrt-home-edit&delete.php" method="post"> <input type="hidden" name="class_name" value="$class_name[0]"/> <button id="button-submit_2" type="submit">Finish</button></form> </td> </tr> The above code puts the two buttons on their own lines within the table cell. My question is, does anybody know how to keep them on the same line without putting them into their own individual cells? i want the entire table cell to be the link, not just the text inside any ideas? So i am building a site for a friend, and created a navigational bar across the top with 7 tabs. The bg color is currently blue with white letters, and I want to make it white with black letters on a mouseover. I tried a couple different things from google, and nothing worked. Here is the code for the table. I would appreciate all the help I can get. Thanks! <HTML> <HEAD> <TITLE>Moxie Communication</TITLE> <style type="text/css"> p {font-family: Univers LT Std 45 Light} td {font-family: Univers LT Std 45 Light} </STYLE> </HEAD> <BODY bgcolor="#000000" style="color:white" vlink=white alink=black> <TABLE border=0 height=100 align=center bgcolor=#1A1919> <TR> <TD valign=top> <img src="F:\MOXIE\Website Images\Moxie_Top.jpg"> <TABLE border=0 width=100% cellpadding=9 cellspacing=1 bgcolor=#0054B4> <TR align=center> <TD><font size=2><a href="moxie.htm">HOME</a></font></TD> <TD><font size=2><a href="about.htm">ABOUT</a></font></TD> <TD><font size=2><a href="services.htm">SERVICES</a></font></TD> <TD><font size=2><a href="clients.htm">CLIENTS</a></font></TD> <TD><font size=2><a href="pricing.htm">PRICING</a></font></TD> <TD><font size=2><a href="team.htm">MEET THE TEAM</a></font></TD> <TD><font size=2><a href="contact.htm">CONTACT</a></font></TD> </TR> </TABLE> I am doing a simple calendar. I managed to do the table with days etc. I have a problem I wish to highlight a number and the cell automatically according to the date of the day. Can Someone help please? Thanks & best regards I recently made a rollover menu, and though the text does highlight when I roll over the cell, the link only works if I rollover the word is the cell. Is there a way to make the cell itself link? I've got a small problem, i want to make a table cell that works as a button. I tried it this way: Code: <table border='1' width='100%' height='10%'> <tr> <a href='page.htm'> <td width='20%' height='100%'> </td> </a> But this won't work, does anybody know how I can solve this problem? |