mattvit Posted August 19, 2011 Share Posted August 19, 2011 I know I'm pushing it here, haha, but I was hoping for CSS help! I hate to say it, but I copied this CSS from here: http://www.red-team-design.com/feature-table-design-with-css3 I did this partly because I am colorblind, partly because I know little CSS. So the problem is, this CSS seems to cause the table to stretch/spread across the entire length of the page. (Well, across the content area, which is 900px, but that's irrelevant). Here's the code: .features-table { width: 100%; margin: 0 auto; border-collapse: separate; border-spacing: 0; text-shadow: 0 1px 0 #fff; color: #2a2a2a; background: #fafafa; background-image: -moz-linear-gradient(top, #fff, #eaeaea, #fff); /* Firefox 3.6 */ background-image: -webkit-gradient(linear,center bottom,center top,from(#fff),color-stop(0.5, #eaeaea),to(#fff)); } .features-table td { height: 50px; line-height: 50px; padding: 0 20px; border-bottom: 1px solid #cdcdcd; box-shadow: 0 1px 0 white; -moz-box-shadow: 0 1px 0 white; -webkit-box-shadow: 0 1px 0 white; white-space: nowrap; text-align: center; } /*Body*/ .features-table tbody td { text-align: center; font: normal 12px Verdana, Arial, Helvetica; width: 150px; } .features-table tbody td:first-child { width: auto; text-align: left; } .features-table td:nth-child(2) { background: #efefef; background: rgba(144,144,144,0.15); border-right: 1px solid white; } .features-table td:nth-child(3) { background: #e7f3d4; background: rgba(184,243,85,0.3); } /*Header*/ .features-table thead td { font: bold 1.3em 'trebuchet MS', 'Lucida Sans', Arial; -moz-border-radius-topright: 10px; -moz-border-radius-topleft: 10px; border-top-right-radius: 10px; border-top-left-radius: 10px; border-top: 1px solid #eaeaea; } .features-table thead td:first-child { border-top: none; } /*Footer*/ .features-table tfoot td { font: bold 1.4em Georgia; -moz-border-radius-bottomright: 10px; -moz-border-radius-bottomleft: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; border-bottom: 1px solid #dadada; } .features-table tfoot td:first-child { border-bottom: none; } I'd like to be able to control the table width with the table tag, ie <table class="features-table" width=200>, but it won't allow me. Thanks, I know this is a PHP forum but I thought someone may still be able to help edit: I have tried changing things around, mainly guesswork, and tried looking up some CSS (not much) so I haven't just copied and pasted the code straight to here!! ) Quote Link to comment https://forums.phpfreaks.com/topic/245214-css-designed-table-help/ Share on other sites More sharing options...
xyph Posted August 19, 2011 Share Posted August 19, 2011 You have to change the width from 100% to 200 px in the .features-table style. The width of .features-table td might force it to be bigger though. Or you could just wrap the table in a 200 px div container. BTW - Not PHP! Quote Link to comment https://forums.phpfreaks.com/topic/245214-css-designed-table-help/#findComment-1259493 Share on other sites More sharing options...
mattvit Posted August 19, 2011 Author Share Posted August 19, 2011 Thankyou, that worked perfectly! Really appreciate it! Haha and I know - I thought, "there's gotta be a CSS whizz here somewhere..!" Quote Link to comment https://forums.phpfreaks.com/topic/245214-css-designed-table-help/#findComment-1259535 Share on other sites More sharing options...
cssfreakie Posted August 19, 2011 Share Posted August 19, 2011 Thankyou, that worked perfectly! Really appreciate it! Haha and I know - I thought, "there's gotta be a CSS whizz here somewhere..!" This is the css forum We also have a html, javascript server etc forum. And yeah all under the roof of phpfreaks Quote Link to comment https://forums.phpfreaks.com/topic/245214-css-designed-table-help/#findComment-1259561 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.