Welcome to WebmasterWorld Guest from 54.146.221.231

Forum Moderators: not2easy

Message Too Old, No Replies

tables and css

please comment/help

     
7:18 pm on Feb 16, 2004 (gmt 0)

Preferred Member

10+ Year Member

joined:Jan 16, 2001
posts:585
votes: 0


Being a new to css user, I have a question that I need help/advice on. I have 3 columns in a table, can each columns have it's own style to it?
If so, how would it be called:

<td class"rightcolumn">?

Appreciate any help and your thoughts.

Thanks,

8:19 pm on Feb 16, 2004 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member 10+ Year Member

joined:Oct 2, 2003
posts:948
votes: 4


Hi there Acternaweb,


I have 3 columns in a table,
can each column have it's own
style to it?


Yes it can.
Here is an example...


<html>
<head>

<style type="text/css">
<!--
table{border:solid 1px #000000;}
#left {width:100px;height:100px;background-color:#ff0000;border:solid 1px #000000;}
#center {width:100px;height:100px;background-color:#00ff00;border:solid 1px #000000;}
#right {width:100px;height:100px;background-color:#0000ff;border:solid 1px #000000;}
//-->
</style>

</head>
<body>

<table><tr>
<td id="left">left</td>
<td id="center">center</td>
<td id="right">right</td>
</tr></table>

</body>
</html>

Being new to csss, you may find
this link extremely useful..


w3schools [w3schools.com]

birdbrain

9:55 pm on Feb 16, 2004 (gmt 0)

Preferred Member

10+ Year Member

joined:Jan 16, 2001
posts:585
votes: 0


Cool thanks for the tip. I have found a way to do this (at least I think I am doing it) in CSS instead of using tables.

Two quick questions that I hope someone can help be answered:

*difference between div class and span class
* do you need to tag each paragraph?

Thanks for the site it looks like a great start

10:10 pm on Feb 16, 2004 (gmt 0)

Preferred Member

10+ Year Member

joined:Mar 20, 2002
posts:521
votes: 0


You don't need a new tag for every paragraph. You simply need to enclose all the elements you want controled by a particular CSS rule with the opening and closing tag.

For instance:

<div class"right" >
<h1> My Paragraph </h1>
<p>This is my first paragraph. </p>
<p>&nbsp;</p>
<h2> Second Paragraph </h2>
<p>This is my second paragraph. </p>
</div>

And before you ask, yes you can but a div inside a div.

I will let someone how can clearly define the div and span tag answer the rest of your question.

11:12 pm on Feb 16, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 24, 2003
posts:175
votes: 0


span and div are both generic elements but divs are block-level (like paragraphs and headings) and spans are inline (like anchors and strong tags).

Adam