Forum Moderators: not2easy

Message Too Old, No Replies

Using tables for tables...

with CSS controlling them...?

         

Jay_R

9:16 pm on Jul 28, 2003 (gmt 0)

10+ Year Member



So, just as I'm starting to feel a little competent at CSS, I run into a few other questions with hard to locate answers.

I want to use a table, but I want to control it with the CS Sheet. Does anyone know what table attributes, or properties you can use in the stylesheet?

For example, the border property in the table selector doesn't work for the whole table. Do I have to specify these values in the HTML for them to work, or can I use a Style Sheet selector property?

Also, does anyone know how to set a static amount of body background space at the bottom of a document, the padding-bottom property doesn't seem to be working for me..

Again, thanks for any help, I really appreciate it.

-Jay :)

DrDoc

9:23 pm on Jul 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One table specific property:
border-collapse: collapse;

You can also set height/border/padding etc on the cells, not just the table as a whole.

drbrain

9:27 pm on Jul 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use the table, tr, and td element selectors to control your tables. table applies to the whole table, tr applies to a row, and td to a cell.

td { border: 5px solid red; }

Will give all of your tablecells a 5px solid red border. The border-spacing property for a table will set the distance between cell borders. You can read more in the CSS2 spec section on Tables [w3.org]

Jay_R

12:33 am on Jul 29, 2003 (gmt 0)

10+ Year Member



Thnks Dr.'s I appreciate the help, especially the link. I've been reading through and have learned much. It's the simple thing I can't seem to get though.

The normal HTML table attribute border=1 puts a nice little uniform ridge throughout the table. In my mind this is layout, and I want to have the effect come from my CS sheet, not an attribute in the HTML file. So how can I do that? The border property acts differently in the style sheet, Any Idea's?

Again and as always, your help is very much appriciated.

-Jay :)