...

View Full Version : Chagning color of table border.



blueandconfused
07-09-2005, 11:38 PM
How do I change the color of a table border using a CSS?

JamieR
07-09-2005, 11:40 PM
wouldn't
table {
border: *px solid #123;
}
work? or does that insert a border around the border of the table?

Scootertaj
07-09-2005, 11:58 PM
Must you complicate everything weazel?? :D
I believe just using:

table {
border-color: #color
}


and

table {
border-style: style
}
for a style would work :)

blueandconfused
07-10-2005, 12:03 AM
that works perfect. how do i get the columns and rows to change color also?

Jalenack
07-10-2005, 12:07 AM
table {
border: 2px solid #8f8;
border-width: 2px 0 0 2px;
}

td {
border: 2px solid #8f8;
border-width: 0 2px 2px 0;
}

You may have to play with the padding and spacing and all to get it to work right, but that'll get you started.

Scootertaj
07-10-2005, 12:09 AM
Um... to do that I believe you would have to give the <td>'s and <tr>'s classes. For example:

HTML:

<tr>
<td class="red">Blah blah</td>
</tr>
<tr>
<td class="blue">Blah blah</td>
</tr>

CSS:

.red {
background-color: #ff0000;
}
.blue {
background-color: #0000ff;
}


Use my method if you want the background color to be changed, use Jalenack's if you want the border color changed, or use both :)

blueandconfused
07-10-2005, 12:35 AM
i have another questions. can you tell me what is wrong with this code? everything is showing up in the table that's in the body section and i only want the band names to be in that table.



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD/XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Music-A Bands</title>
<link rel="stylesheet" href="main.css" type="text/css"/>
<STYLE>
.TA {scrollbar-3dlight-color:#00FFFF;
scrollbar-arrow-color:#FF0000;
scrollbar-base-color:#000000;
scrollbar-darkshadow-color:#CC0000;
scrollbar-face-color:#000000;
scrollbar-highlight-color:#000000;
scrollbar-shadow-color:#FFFF00}
</STYLE>
</head>
<body bgcolor="white">
<table border="0" width = 95% cellpadding="0" cellspacing="0">
<tr>
<td colspan="1"><img src="images/avengedsevenfold.jpg"></td>
<td colspan="1"><font size="6pz"><center>A Bands</center></font></td>

</tr>

<tr>
<td width="20%" valign="top"><b><br />
<font size="4pz"><a href="index.html">Home</a>
<br />
<br />
<a href="poems.html">Poems</a>
<br />
<br />
<a href="music.html">Music</a>
<br />
<br />
<a href="photoalbum.html">Photo Album</a>
<br />
<br />
<a href="guestbook.html">Guestbook</a>
<br />
<br />
<a href="http://www.myspace.com/krazykrisi">MySpace</a></font>
</td>
<td width="75%" valign="top">
<div>
<br />
<br />
<center>
<table border="1" bordercolor=#FF0000; width="40%" cellpadding="2" cellspacing="2">
<tr><td><b>Band Name</b></td> <td><b>Genre</b></td></tr>
<tr><td><a href="http://www.lyricstar.com/songlyrics/artist/A-Death-For-Every-Sin/1078">A Death For Every Sin</a></td><td>Rock</td></tr>
<tr><td><a href="http://www.afaithcalledchaos.com/">A Faith Called Chaos</a></td><td>Rock</td></tr>
<tr><td><a href="http://www.alifeoncelost.com/">A Life Once Lost</a></td><td>Rock</td></tr>
<tr><td><a href="http://www.newfoundglory.com/">A New Found Glory</a></td><td>Rock</td></tr>
<tr><td><a href="http://www.aperfectcircle.com/">A Perfect Circle</a></td><td>Rock</td></tr>
<tr><td><a href="http://www.astaticlullaby.com/">A Static Lullaby</a></td><td>Rock
<tr><td><a href="http://www.athornforeveryheart.com/">A Thorn For Every Heart</a></td><td>Rock</td></tr>
<tr><td><a href=">Absurd</a></td><td>Rock</td></tr>
<tr><td>Accidental Superhero</td><td>Rock</td></tr>
<tr><td>Adema</td><td>Post-Grunge</td></tr>
<tr><td>After Forever</td><td>Heavy Metal</td></tr>
<tr><td>Alien Ant Farm</td><td>Alternative Metal</td></tr>
<tr><td>Anatomy of A Ghost</td><td>Emo</td></tr>
<tr><td>Andrew W.K</td><td>Hard Rock</td></tr>
<tr><td>Antithesis</td><td>Rock</td></tr>
<tr><td>Apartment 26</td><td>Heavy Metal</td></tr>
<tr><td>The Arcade Fire</td><td>Indie Rock</td></tr>
<tr><td>The Arrogant Sons of *****es</td><td>Rock</td></tr>
<tr><td>As I Lay Dying</td><td>Heavy Metal</td></tr>
<tr><td>The Ataris</td><td>Punk-Rock</td></tr>
<tr><td>Audio Adrenaline</td><td>Christian</td></tr>
<tr><td>Audioslave</td><td>Heavy Metal</td></tr>
<tr><td>Avenged Sevenfold</td><td>Emo</td></tr>
<tr><td>AFI</td><td>Punk</td></tr>
</table>
</center>
<br />
<br />
<center><a href="a.html">A</a> <a href="b.html">B</a> <a href="c.html">C</a> <a href="d.html">D</a>
<a href="e.html">E</a> <a href="f.html">F</a> <a href="g.html">G</a> <a href="h.html">H</a> <a href="i.html">I</a>
<a href="j.html">J</a> <a href="k.html">K</a> <a href="l.html">L</a> <a href="m.html">M</a> <a href="n.html">N</a>
<a href="o.html">O</a> <a href="p.html">P</a> <a href="q.html">Q</a> <a href="r.html">R</a> <a href="s.html">S</a>
<a href="t.html">T</a> <a href="u.html">U</a> <a href="v.html">V</a>
<a href="w.html">W</a> <a href="x.html">X</a> <a href="y.html">Y</a> <a href="z.html">Z</a></CENTER>

<hr />

<center><b><a href="index.html">Home</a> | <a href="poems.html">Poems</a> | <a href="music.html">Music</a> |
<a href="photoalbum.html">Photo Album</a> | <a href="guestbook.html">Guestbook</a> |
<a href="http://www.myspace.com/krazykrisi">MySpace</a></b></center>
</div>
</td>
</tr>
</table>

</body>
</html>

Jalenack
07-10-2005, 05:03 AM
Hmm, well without looking at the rendering it's hard to tell. Could you point us to this file?

When stuff like this happens, it's usually just a problem that can be spotted by a validator.

I did notice you have a random <font size="4pz"> in there. pz is not a unit.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum