knuhe Posted May 7, 2006 Share Posted May 7, 2006 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! Quote Link to comment Share on other sites More sharing options...
moberemk Posted May 7, 2006 Share Posted May 7, 2006 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 Link to comment Share on other sites More sharing options...
knuhe Posted May 7, 2006 Author Share Posted May 7, 2006 [!--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? Quote Link to comment Share on other sites More sharing options...
moberemk Posted May 7, 2006 Share Posted May 7, 2006 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 Link to comment Share on other sites More sharing options...
knuhe Posted May 7, 2006 Author Share Posted May 7, 2006 [!--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? Quote Link to comment Share on other sites More sharing options...
neylitalo Posted May 7, 2006 Share Posted May 7, 2006 CSS and divs are a pretty solid replacements for tables. Quote Link to comment Share on other sites More sharing options...
knuhe Posted May 7, 2006 Author Share Posted May 7, 2006 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 capableof answering my initial question?What do I have to write in CSS to get the equivalent of cellpadding, cellspacing and border? Quote Link to comment Share on other sites More sharing options...
neylitalo Posted May 7, 2006 Share Posted May 7, 2006 Ah, yes, the original question. :DThe "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 Link to comment Share on other sites More sharing options...
knuhe Posted May 7, 2006 Author Share Posted May 7, 2006 [!--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. :DThe "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 Quote Link to comment Share on other sites More sharing options...
moberemk Posted May 8, 2006 Share Posted May 8, 2006 [!--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. Quote Link to comment Share on other sites More sharing options...
knuhe Posted May 8, 2006 Author Share Posted May 8, 2006 [!--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;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.