butsags Posted October 18, 2009 Share Posted October 18, 2009 Hey guys. to clear things up, this is in php but its mostly html and the error I am having is the html functioning so I figured it was fit for the html section. If I was wrong in putting it in this board then by all means move it to the correct section and I am gratefully sorry. Okay now that thats cleared up, here's whats going on: I have a page and I would like it to start scrolling one it goes beyond a height of 204. here's the script: <table background=\"images/items.png\" width=177 height=289 style=\" padding-top: 22px; background-repeat: no-repeat;\"> <tr> <td style=\"padding-top: 2px; padding-left: 4px; \" valign=\"top\">"; $queryz = mysql_query("SELECT * FROM inventoryitems WHERE characterid = '$id' AND inventorytype = 1 AND quantity != 0");// Account section echo " <DIV id=\"tabcontent1\" style=\"MARGIN-LEFT: 0px; MARGIN-RIGHT:0px; OVERFLOW-X: hidden; OVERFLOW: auto; HEIGHT: 204;\"> <table cellspacing=0 cellpadding=0 border=0> <tr>"; while($row = mysql_fetch_array($queryz)){ $item = $row[itemid]; if ($p%4==0 AND $p>=3) { echo " </tr> <tr>"; } else { } echo " <td background=\"images/bgitem.jpg\" width=36 height=34 align=\"center\"> <img src=\"http://www.mapletip.com/images/maplestory-monsters/0$item.png\" style=\"max-width:36px; max-height:34px;\" alt=\" \"> </td>"; $p++; } echo " </tr> </table> </div>"; As you can see, I am trying to get the content located in the <div> tags to scroll . it doesn't necessarily have to be div tags or anything as long as the scroll works and the content lays inside still anyone have any ideas? Quote Link to comment Share on other sites More sharing options...
merylvingien Posted October 18, 2009 Share Posted October 18, 2009 Not quite sure what you mean by the page scroll after a height of 204? Or do you mean content of the div after its 204? You can do this with content overflow in css. div#tabcontent1 { height:204px; overflow: scroll } Try it out! Quote Link to comment Share on other sites More sharing options...
butsags Posted October 18, 2009 Author Share Posted October 18, 2009 yeah i would like the overflow to scroll once it reaches over 204 px. i tried it out but it didnt seem to work :/ isnt that weird? Quote Link to comment Share on other sites More sharing options...
merylvingien Posted October 19, 2009 Share Posted October 19, 2009 What exactly is going in the tabcontent1 div? I have stripped back all your php stuff to leave just the html code so i can see whats going on. There was a error with the html, but that didnt stop the overflow working. Just so we can establish that you are seeing what i am seeing, try this plain html code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="test.css" /> </head> <body> <td background="images/items.png" width=177 height=289 style=" padding-top: 22px; background-repeat: no-repeat"> <tr> <td style="padding-top: 2px; padding-left: 4px;" valign="top"> <div id="tabcontent1"> <table cellspacing=0 cellpadding=0 border=0> <tr> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <p>some text</p> <td background="images/bgitem.jpg" width=36 height=34 align="center"> <img src="http://www.mapletip.com/images/maplestory-monsters/0$item.png" style="max-width:36px; max-height:34px;" alt=" "> </td> </tr> </table> </div> </body> </html> Then in a seperate style sheet named "test.css" div#tabcontent1 { height:204px; overflow: scroll } I know its going back to basics, but sometimes its the best way to find a problem. That code should scroll anything within the div "tabcontent1" Quote Link to comment Share on other sites More sharing options...
butsags Posted October 22, 2009 Author Share Posted October 22, 2009 hey i figured out the problem. its actualy simply the overflow-x:hidden; part that wasnt allowing the rest of it to flow. i moved the div styles to the stylesheet anyway to clear things up a bit. I dont realy need the overflow-x:hidden; tag because if u use overflow:auto; then it works just as well. thanks problem solved 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.