View Full Version : Chagning color of table border.

07-10-2005, 12:38 AM
How do I change the color of a table border using a CSS?

07-10-2005, 12:40 AM
table {
border: *px solid #123;
work? or does that insert a border around the border of the table?

07-10-2005, 12:58 AM
Must you complicate everything weazel?? :D
I believe just using:

table {
border-color: #color


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

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

07-10-2005, 01: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.

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


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


.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 :)

07-10-2005, 01: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"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<title>Music-A Bands</title>
<link rel="stylesheet" href="main.css" type="text/css"/>
.TA {scrollbar-3dlight-color:#00FFFF;
<body bgcolor="white">
<table border="0" width = 95% cellpadding="0" cellspacing="0">
<td colspan="1"><img src="images/avengedsevenfold.jpg"></td>
<td colspan="1"><font size="6pz"><center>A Bands</center></font></td>


<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 width="75%" valign="top">
<br />
<br />
<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>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>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>
<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>


07-10-2005, 06: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.