Newbie question about CSS - can you apply a style to an entire table or only to a <TD> cell

S

Shiperton Henethe

A newbie question about CSS:

Is it possible to set a style once and
then have it apply the an entire table of data?

Or do you have to keep resetting it on
every <TD> ?

Ship
 
R

rf

Shiperton Henethe said:
A newbie question about CSS:

Is it possible to set a style once and
then have it apply the an entire table of data?
Yes.

Or do you have to keep resetting it on
every <TD> ?

No.

td {properties...}

<table>
<tr>
<td>
....

of if you wish to restrict it to this specific table:

..this td {properties...}

<table class="this">
<tr>
<td>
....
 
R

rf

Yo brucie. Welcome back mate.
table td{... }

Isn't the table bit a little superfluous considering the only place a <td>
can be is somewhere inside a <table>?

Small picky point I know but is looking to become a slow day :)

Cheers
Richard.
 
S

Shiperton Henethe

brucie said:

I am a total newbie!
The aweful thing is that I've clean forgotten
everything I ever knew about CSS.

I need a special file with all my CSS definitions
in, right? And then I need some code somewhere in
my HTML page that includes this CSS definitions
page... (??)

So in this CSS definitions file need something
like:

table td{ font-family: sans-serif }

And then *all* references to <TD> contents in the page will
have sans-serif applied to them?

Am I close...?

* * *

- Can you recommend a very basic idiot's guide
to CSS. I am drowning in details!

Ship
 
A

Adrienne

I am a total newbie!
The aweful thing is that I've clean forgotten
everything I ever knew about CSS.

I need a special file with all my CSS definitions
in, right? And then I need some code somewhere in
my HTML page that includes this CSS definitions
page... (??)

<head>
<title>My CSS Page</title>
<link type="text/css" rel="stylesheet" ref="styles.css">
<style type="text/css">
<!--
/* this will over-ride the external styles.css sheet */
body {
background-color:#fff;
color:#000
}
-->
</style>
So in this CSS definitions file need something
like:

table td{ font-family: sans-serif }

And then *all* references to <TD> contents in the page will
have sans-serif applied to them?

Am I close...?

* * *

- Can you recommend a very basic idiot's guide
to CSS. I am drowning in details!

http://www.w3schools.com/css/default.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top