Jump to content

Table properties


knuhe

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!
Link to comment
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?
Link to comment
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.
Link to comment
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?
Link to comment
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?

Link to comment
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]
Link to comment
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
Link to comment
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.
Link to comment
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;)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.