Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Chagning color of table border.

    How do I change the color of a table border using a CSS?

  • #2
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    wouldn't
    table {
    border: *px solid #123;
    }
    work? or does that insert a border around the border of the table?

  • #3
    Regular Coder
    Join Date
    Sep 2004
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Must you complicate everything weazel??
    I believe just using:
    Code:
    table {
    border-color: #color
    }
    and
    Code:
    table {
    border-style: style
    }
    for a style would work

  • #4
    New Coder
    Join Date
    Mar 2005
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that works perfect. how do i get the columns and rows to change color also?

  • #5
    Regular Coder
    Join Date
    May 2004
    Location
    Berkeley, California Age: 15
    Posts
    398
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Jalenack.com .:. YWDA Founder .:. Rounded Corners Maker 1.1! .:. My Blog
    The hardest thing about teaching is not knowing the right answers, but knowing the right questions - Elisabeth Klein
    Pretty buttons does not a great website make.

  • #6
    Regular Coder
    Join Date
    Sep 2004
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Um... to do that I believe you would have to give the <td>'s and <tr>'s classes. For example:

    HTML:
    Code:
    <tr>
    <td class="red">Blah blah</td>
    </tr>
    <tr>
    <td class="blue">Blah blah</td>
    </tr>
    CSS:
    Code:
    .red {
    background-color: #ff0000;
    }
    .blue {
    background-color: #0000ff;
    }
    Edit:
    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

  • #7
    New Coder
    Join Date
    Mar 2005
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

    Code:
    <?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>

  • #8
    Regular Coder
    Join Date
    May 2004
    Location
    Berkeley, California Age: 15
    Posts
    398
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Jalenack.com .:. YWDA Founder .:. Rounded Corners Maker 1.1! .:. My Blog
    The hardest thing about teaching is not knowing the right answers, but knowing the right questions - Elisabeth Klein
    Pretty buttons does not a great website make.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •