View Full Version : CSS with tables


stefp9
08-16-2003, 07:54 PM
I use an external style sheet that is linked to all of my pages. However, when I code a table into a page, the style does not effect anything within the table. Is there any way to fix this?

MaGiCSuN
08-16-2003, 08:00 PM
add td, tr to the coding. Like this

normally you have body { codes here }
but now you have to add td, tr to it so it becomes:

body, tr, td { codes here }

Love,
Mirna

stefp9
08-16-2003, 08:13 PM
Perhaps I haven't been too clear about what my problem is...let me apologize.

My code thus far looks something like this

html
head
link to style sheet
/head
body
table
tr
td
text, which the style isn't affecting, which is my problem
/td
/tr
/table
/body
/html

If you remove the table and /table and just have tr and td, the style will work on the text, sure. But the effect I was going for by using a table is gone.

Dude128
08-16-2003, 09:39 PM
did you try what Mirna posted?

CSS in the body { ... } section doesn't affect tables, that's why you have to add td at least.

so instead of having a line that looks like this in your CSS:

body {
...

change it to:

body, td {
...

and that will apply those CSS attributes both to the body itself and to all table cells.