mentalist Posted June 7, 2010 Share Posted June 7, 2010 The easiest way to demonstrate this is with a touch of code: <div style='width:400px;background-color:#aff;font-size:16px;'> This should be about the right width...............<br /> <br /> <!--<table width='100%'><tr><td>--> <div style='background-color:#faf;font-size:16px;'><pre>This is an extra long piece of text which will need to overflow onto the next line or push out...</pre></div> <br /> <div style='background-color:#faf;font-size:16px;overflow-x:scroll;'><pre>This is an extra long piece of text which will need to overflow onto the next line or push out...</pre></div> <br /> <div style='background-color:#faf;font-size:16px;overflow-x:scroll;white-space:pre;'>This is an extra long piece of text which will need to overflow onto the next line or push out...</div> <br /> <!--</td></tr></table>--> </div> As is the code should do what it's supposed to do. But if you remove the quotes and wrap the divs in a table then they inherit width from somewhere and push out of the container... Any suggestions as to how to restrain them? Cheers! P.S. I can't stop these overflow divs from not being placed within tables, so just removing the table is not enough. Quote Link to comment https://forums.phpfreaks.com/topic/204103-overflow-div-in-a-table/ Share on other sites More sharing options...
lemmin Posted June 9, 2010 Share Posted June 9, 2010 Can you be more specific with what you are trying to accomplish? I don't see any difference with or without the table. Besides, you aren't even setting a width for the divs, so I don't know what width you want. Quote Link to comment https://forums.phpfreaks.com/topic/204103-overflow-div-in-a-table/#findComment-1070069 Share on other sites More sharing options...
mentalist Posted October 25, 2010 Author Share Posted October 25, 2010 It's been a while and if I remember correctly I found a workaround (from linuxquestions.org forum source), but... The container div has a width, I was wanting everything inside to conform to that width (as a max anyway). p.s. I'll try and find the solution I found and post it (can't believe I didn't at the time...) Quote Link to comment https://forums.phpfreaks.com/topic/204103-overflow-div-in-a-table/#findComment-1126112 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.