Jump to content


Photo

Table properties


  • Please log in to reply
10 replies to this topic

#1 knuhe

knuhe
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 07 May 2006 - 05:07 PM

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:

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

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

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

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

Thank you for this valuable forum!

#2 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 07 May 2006 - 05:27 PM

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.
Disclaimer: No matter how harsh I may be, I'm always IMO only.

#3 knuhe

knuhe
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 07 May 2006 - 05:32 PM

[!--quoteo(post=372072:date=May 7 2006, 07:27 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ May 7 2006, 07:27 PM) View Post[/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?

#4 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 07 May 2006 - 06:07 PM

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.
Disclaimer: No matter how harsh I may be, I'm always IMO only.

#5 knuhe

knuhe
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 07 May 2006 - 06:18 PM

[!--quoteo(post=372079:date=May 7 2006, 08:07 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ May 7 2006, 08:07 PM) View Post[/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?

#6 neylitalo

neylitalo
  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 07 May 2006 - 06:25 PM

CSS and divs are a pretty solid replacements for tables.
http://nealylitalo.net - My personal website, and home of The Netizen's Journal.

#7 knuhe

knuhe
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 07 May 2006 - 06:34 PM

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?



#8 neylitalo

neylitalo
  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 07 May 2006 - 06:55 PM

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
border: solid 1px black;

http://nealylitalo.net - My personal website, and home of The Netizen's Journal.

#9 knuhe

knuhe
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 07 May 2006 - 07:06 PM

[!--quoteo(post=372089:date=May 7 2006, 08:55 PM:name=neylitalo)--][div class=\'quotetop\']QUOTE(neylitalo @ May 7 2006, 08:55 PM) View Post[/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
border: solid 1px black;
[/quote]

Thanks!

Just what I wanted:D


#10 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 08 May 2006 - 12:05 AM

[!--quoteo(post=372082:date=May 7 2006, 02:18 PM:name=Knut)--][div class=\'quotetop\']QUOTE(Knut @ May 7 2006, 02:18 PM) View Post[/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.
Disclaimer: No matter how harsh I may be, I'm always IMO only.

#11 knuhe

knuhe
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 08 May 2006 - 07:17 PM

[!--quoteo(post=372158:date=May 8 2006, 02:05 AM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ May 8 2006, 02:05 AM) View Post[/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;)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users