9999 Posted March 16, 2007 Share Posted March 16, 2007 Given this line, what is the php syntax to set background color to black and prevent a scroll bar from showing? echo'<table style="width:325px; height:160px; padding:0px; border:0px"><tr><td>'; Thanks Quote Link to comment https://forums.phpfreaks.com/topic/43034-setting-background-color-and-preventing-scrolling-in-table/ Share on other sites More sharing options...
pocobueno1388 Posted March 16, 2007 Share Posted March 16, 2007 This is more of an HTML problem...but here is your answer. echo'<table bgcolor='black' style="width:325px; height:800px; padding:0px; border:0px"><tr><td>'; To get it to stop scrolling, I just adjusted the height. Quote Link to comment https://forums.phpfreaks.com/topic/43034-setting-background-color-and-preventing-scrolling-in-table/#findComment-209006 Share on other sites More sharing options...
9999 Posted March 16, 2007 Author Share Posted March 16, 2007 Thanks. I want to keep the dimensions as a had them, I just don't want a scroll bar to be added. Sometimes one is added even when not needed. Quote Link to comment https://forums.phpfreaks.com/topic/43034-setting-background-color-and-preventing-scrolling-in-table/#findComment-209012 Share on other sites More sharing options...
kenrbnsn Posted March 16, 2007 Share Posted March 16, 2007 Since the OP is already using CSS in the "style" attribute, he should continue to use that to set the background color: <?php echo '<table style="background-color:black;overflow:hidden;width:325px; height:160px; padding:0px; border:0px"><tr><td>'; ?> The "overflow:hidden" should keep the scrollbars from appearing. Now I will move this to the CSS forum where it belongs... Ken Quote Link to comment https://forums.phpfreaks.com/topic/43034-setting-background-color-and-preventing-scrolling-in-table/#findComment-209041 Share on other sites More sharing options...
9999 Posted March 16, 2007 Author Share Posted March 16, 2007 The horizontal scroll bar is gone but the vertical scroll bar stays. :'( My output will never need to scroll as it will alwys fit. I am just using this to set backgound color and vertically align. Quote Link to comment https://forums.phpfreaks.com/topic/43034-setting-background-color-and-preventing-scrolling-in-table/#findComment-209181 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.