Re: CSS and table cell borders

by "Beth Adler" <doglover(at)cgmailbox.com>

 Date:  Mon, 20 Jan 2003 21:24:00 -0700
 To:  "HWG Basics" <hwg-basics(at)hwg.org>
 References:  s8x1s5 riveraamd
  todo: View Thread, Original
Thanks Tim.  I had no idea you could do that.  That really helps.  I'm new
to CSS but I want to do it right.  I think I got the table the way I want it
now.  To get a thick border around the whole table and a thin one on the
right side of each cell I used two table definitions in the style sheet: one
with the td after it to apply to all the cells for the thin lines, and one
without it to apply to just the table itself for the thick border.  Is this
the right way to do it?  I ended up with an extra right border on the last
column, but since it's only 1 pixel and the same color as the table border,
I don't think anyone will notice.  The table (consignment sale) is at:
www.beth1.netfirms.com/Invitational.html.  Comments are welcome.

Question.  I had to put "cellspacing=0" in the table tag or else the
background showed through around every cell.  What is the CSS equivalent of
this?  I tried both "cellspacing: 0" and "spacing: 0" and they didn't work.

Does anyone know of a good CSS book that's relatively easy to understand for
a beginner?

Beth
www.teddybearwebdesign.com



> I can also put 'border-right: solid 1px #000080' in the stylesheet for all
> the td cells (except the last column) in that particular table, which
allows
> me to do exactly what I want, but I'd have to go through and add it to
every
> one separately (34 rows x 5 columns = 170 times!).  Since I have several
> tables other than this one, I can't use search and replace.


Why would you have to add inline styles to every cell? Just use your style
sheet.


table.thistable td {border-right: solid 1px #000080}

<table class="thistable">
 <tr>
  <td>All these cells have a green border on the right side</td>
  <td>All these cells have a green border on the right side</td>
  <td>All these cells have a green border on the right side</td>
 </tr>
</table>


Tim

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA