how to define properties of table border with css?

B

Bernd Meier

I defined table.propertiesfortables {color:green; background-color:#FFFF00;
border="5" solid blue} as CSS.
I start my table with the tag: <table class=propertiesfortables>

Font is green and background yellow but I didn't get border lines.
But if I use table.propertiesfortables {color:green;
background-color:#FFFF00}
as CSS and then begin table tag with <table class=propertiesfortables
border="5" solid blue>
I get blue border line.

Why don't I get blue border lines for my table with first example with CSS
and what have
I to change to get them with CSS?
 
J

Jeff

Bernd said:
I defined table.propertiesfortables {color:green;
background-color:#FFFF00; border="5" solid blue} as CSS.

for one thing that isn't correct CSS.

try: border: solid blue 5px

for another, do you want a border around the table or the cells?:

table.propertiesfortables td{border: solid blue 5px;}

Also look up border-collapse: collapse

Styling tables with CSS is a different animal than you think.

I'm sure there must be a tutorial around somewhere on this.


I start my table with the tag: <table class=propertiesfortables>

Font is green and background yellow but I didn't get border lines.
But if I use table.propertiesfortables {color:green;
background-color:#FFFF00}
as CSS and then begin table tag with <table class=propertiesfortables
border="5" solid blue>

Good html procedure is to use quotes
<table class="propertiesfortables"

Jeff
 
J

J.O. Aho

Bernd said:
I defined table.propertiesfortables {color:green;
background-color:#FFFF00; border="5" solid blue} as CSS.
I start my table with the tag: <table class=propertiesfortables>

Font is green and background yellow but I didn't get border lines.

table.propertiesfortables {
color:green;
background-color:#FFFF00;
border: 5px solid blue;
}

As you see you don't use any '=' in CSS, you use the ':' instead.
 

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,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top