Darkmatter5 Posted June 17, 2008 Share Posted June 17, 2008 Say I have a cell in a table that has more characters then the column width can accommodate and it wraps the text making the row two lines in length instead of just one. How can I turn off that word wrap and maybe even add a comment to the cell that if you hover your cursor over the text it'll show a little box with the cells full contents, but still preserves the single line row look? Thanks! Link to comment https://forums.phpfreaks.com/topic/110625-word-wrap-question/ Share on other sites More sharing options...
rhodesa Posted June 17, 2008 Share Posted June 17, 2008 CSS: style="white-space:no-wrap;overflow:hidden;" Link to comment https://forums.phpfreaks.com/topic/110625-word-wrap-question/#findComment-567548 Share on other sites More sharing options...
Darkmatter5 Posted June 17, 2008 Author Share Posted June 17, 2008 The white-space part worked, but the overflow isn't doing anything. Any ideas why? Link to comment https://forums.phpfreaks.com/topic/110625-word-wrap-question/#findComment-567580 Share on other sites More sharing options...
rhodesa Posted June 17, 2008 Share Posted June 17, 2008 oh yeah...with overflow:hidden you need to specify a width i think Link to comment https://forums.phpfreaks.com/topic/110625-word-wrap-question/#findComment-567586 Share on other sites More sharing options...
Darkmatter5 Posted June 17, 2008 Author Share Posted June 17, 2008 I applied a width and still nothing. Link to comment https://forums.phpfreaks.com/topic/110625-word-wrap-question/#findComment-567600 Share on other sites More sharing options...
rhodesa Posted June 18, 2008 Share Posted June 18, 2008 interesting...i had to wrap it in a block level element to make it work: <style type="text/css"> .narrow td { width: 100px; } .narrow td p { overflow: hidden; white-space: nowrap; } </style> <table class="narrow" border="1"> <tr> <td><p>This is short</p></td> <td><p>This is much much longer and will get cut off</span></td> </tr> </table> Link to comment https://forums.phpfreaks.com/topic/110625-word-wrap-question/#findComment-567726 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.