Kieran Menor Posted October 4, 2009 Share Posted October 4, 2009 Hi, I have this DIV with 100% width and overflow: hidden in a table cell. My problem is that it does not keep these. Instead it stretches the fork out of the page as seen here: http://misc.smwcentral.net/imageview/exhibita.html Now, if you put it in a DIV instead of a table cell, it works completely as expected: http://misc.smwcentral.net/imageview/exhibitb.html How do I make it behave? Link to comment https://forums.phpfreaks.com/topic/176460-solved-div-with-100-width-and-overflow-hidden-in-table/ Share on other sites More sharing options...
CarbonCopy Posted October 4, 2009 Share Posted October 4, 2009 First of all, do not use tables. Second of all, use valid attributes (Style not width). Third, as is, just set the div's width to 500px. Link to comment https://forums.phpfreaks.com/topic/176460-solved-div-with-100-width-and-overflow-hidden-in-table/#findComment-930248 Share on other sites More sharing options...
Kieran Menor Posted October 4, 2009 Author Share Posted October 4, 2009 Don't tell me what not to use. Tables are perfectly fine in the right context. Also, width is a prefectly valid attribute in HTML 4. Lastly, this is merely an example of how it behaves in a table. I do, in fact, need the 100% width, so setting a static width on the div will not solve my problem. Link to comment https://forums.phpfreaks.com/topic/176460-solved-div-with-100-width-and-overflow-hidden-in-table/#findComment-930265 Share on other sites More sharing options...
CarbonCopy Posted October 4, 2009 Share Posted October 4, 2009 My apologies. All I've found so far that worked is <table width="500" style="overflow:hidden;display:block;"> but I am still investigating it. Link to comment https://forums.phpfreaks.com/topic/176460-solved-div-with-100-width-and-overflow-hidden-in-table/#findComment-930286 Share on other sites More sharing options...
CarbonCopy Posted October 4, 2009 Share Posted October 4, 2009 I spoke too soon! <table width="500" style="table-layout: fixed;"> Is that good enough for you? Not sure if it does what you need it to Link to comment https://forums.phpfreaks.com/topic/176460-solved-div-with-100-width-and-overflow-hidden-in-table/#findComment-930287 Share on other sites More sharing options...
Kieran Menor Posted October 4, 2009 Author Share Posted October 4, 2009 It seems to work like a charm. Thanks a lot. Link to comment https://forums.phpfreaks.com/topic/176460-solved-div-with-100-width-and-overflow-hidden-in-table/#findComment-930291 Share on other sites More sharing options...
CarbonCopy Posted October 4, 2009 Share Posted October 4, 2009 No problem, glad it works Link to comment https://forums.phpfreaks.com/topic/176460-solved-div-with-100-width-and-overflow-hidden-in-table/#findComment-930296 Share on other sites More sharing options...
haku Posted October 5, 2009 Share Posted October 5, 2009 Don't tell me what not to use. Tables are perfectly fine in the right context. You are correct, except that the context in which you are using them doesn't appear to be right - images are not tabular data. Link to comment https://forums.phpfreaks.com/topic/176460-solved-div-with-100-width-and-overflow-hidden-in-table/#findComment-930394 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.