Jump to content

Archived

This topic is now archived and is closed to further replies.

knuhe

Table properties

Recommended Posts

Posting this in a new thread so I don't pollute the board with OT.

As I said in my first post in another thread, I'm completely new to CSS, and obviously
have a lot of questions.

I now want to make a class-tag to define my menutables, like the one I'm been using in HTML for a while:

[code]
<table
    width:="155" height="304" border="1" cellpadding="2" cellspacing="0"
    bordercolor="#000000# id="table11" style="border-collapse: collapse"
>
[/code]

Now I want to utilize these properties in CSS for easier editing, and i have something like this:

[code]
.tabellmen1 {
    width: 155px;
    height: 304px;
<!-----{and so on....}----->
[/code]

What do I have to write to get my cellpadding, cellspacing and borders right?

Thank you for this valuable forum!

Share this post


Link to post
Share on other sites
Stop using tables! Stop using tables! Stop using tables! Those are the easy answers. The other answer is to set you're cellpadding and cellspacing values to zero for all.

Share this post


Link to post
Share on other sites
[!--quoteo(post=372072:date=May 7 2006, 07:27 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ May 7 2006, 07:27 PM) [snapback]372072[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Stop using tables! Stop using tables! Stop using tables! Those are the easy answers. The other answer is to set you're cellpadding and cellspacing values to zero for all.
[/quote]

Since you're so determined, you may also explain why I sholdn't use tables?

Share this post


Link to post
Share on other sites
Tables are (a) very resistant to CSS design. It's easy to screw them up when you use CSS on them if you're not careful about it. (b) CSS designs are flexible-if you want to switch the left and right columns, you can. And © a lot less markup. Don't you want to stop typing <tr><td> everywhere?
This and other reasons are explained elsewhere on the web-that's just the basic run-down of advantages.

Share this post


Link to post
Share on other sites
[!--quoteo(post=372079:date=May 7 2006, 08:07 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ May 7 2006, 08:07 PM) [snapback]372079[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Tables are (a) very resistant to CSS design. It's easy to screw them up when you use CSS on them if you're not careful about it. (b) CSS designs are flexible-if you want to switch the left and right columns, you can. And © a lot less markup. Don't you want to stop typing <tr><td> everywhere?
This and other reasons are explained elsewhere on the web-that's just the basic run-down of advantages.
[/quote]

I see your point. Good to get feedback from experienced coders.
What do you recommend I use instead of tables?

Share this post


Link to post
Share on other sites
CSS and divs are a pretty solid replacements for tables.

Share this post


Link to post
Share on other sites
Thanks for all suggestions! I'll have to try using div-tags on a new design.

But back to topic. Since you all seem like experienced coders, I bet one of you are capable
of answering my initial question?

What do I have to write in CSS to get the equivalent of cellpadding, cellspacing and border?

Share this post


Link to post
Share on other sites
Ah, yes, the original question. :D

The "padding" property will do beautifully for cellpadding, "border-spacing" sounds like it'll do the trick for cellspacing, and "border" will work well for border. :D

"border" as in
[code]border: solid 1px black;[/code]

Share this post


Link to post
Share on other sites
[!--quoteo(post=372089:date=May 7 2006, 08:55 PM:name=neylitalo)--][div class=\'quotetop\']QUOTE(neylitalo @ May 7 2006, 08:55 PM) [snapback]372089[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Ah, yes, the original question. :D

The "padding" property will do beautifully for cellpadding, "border-spacing" sounds like it'll do the trick for cellspacing, and "border" will work well for border. :D

"border" as in
[code]border: solid 1px black;[/code]
[/quote]

Thanks!

Just what I wanted:D

Share this post


Link to post
Share on other sites
[!--quoteo(post=372082:date=May 7 2006, 02:18 PM:name=Knut)--][div class=\'quotetop\']QUOTE(Knut @ May 7 2006, 02:18 PM) [snapback]372082[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I see your point. Good to get feedback from experienced coders.
What do you recommend I use instead of tables?
[/quote]
Wow. I'm an experienced coder now? I must be doing better then I thought.

Share this post


Link to post
Share on other sites
[!--quoteo(post=372158:date=May 8 2006, 02:05 AM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ May 8 2006, 02:05 AM) [snapback]372158[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Wow. I'm an experienced coder now? I must be doing better then I thought.
[/quote]

I make a habit of calling everyone who has more experience than me in something for experienced;)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.