Changing bgcolor of specific heading in table
I would like to change the background color of one of the frames in my table. If anyone could help me, I would appreciate it.
I would like to change the background color of one of the frames in my table. If anyone could help me, I would appreciate it.
Ken Elliott posted this at 15:20 — 19th June 2000.
They have: 358 posts
Joined: Jun 1999
You need to change the background color of your table data cell. the format is
code:---------
<table><tr><td bgcolor="Black">
This is just dumb info to fill the table
</td></tr></table>
the key is "bgcolor="Black"" just edit that with your designated color and you got a painted table background.
I have found that sometimes older versions of netscape don't like to show the bgcolor. So on occasion I use a 1x1 pixel image and tile it for my bgcolor.
Just some extra info.
VulKen
Keepin' It Realistic
Pimpin like a pimp with an electrofied pimpin machine!
KeithMcL posted this at 04:56 — 20th June 2000.
He has: 176 posts
Joined: Oct 1999
Here's a nice one for you. Here's a script that will allow you to change the table background color on mouse over. Found at www.dynamicdrive.com
<script language="JavaScript1.2">
/*
Highlight Table Cells Script
Last updated: 99/01/21
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
function changeto(highlightcolor){
source=event.srcElement
if (source.tagName=="TR"| |source.tagName=="TABLE")
return
while(source.tagName!="TD")
source=source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}
function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)| |source.contains(event.toElement)| |source.id=="ignore")
return
if (event.toElement!=source)
source.style.backgroundColor=originalcolor
}
</script>
Then use the tag below in your table tags.
<td align="left" valign="middle" onMouseover="changeto('color1')" onMouseout="changeback('color2')">
Enjoy playing with this opne
------------------
KeithMcL
Soon to come,
webmasterswork.com
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.