brem13 Posted August 12, 2010 Share Posted August 12, 2010 hey, i'm calling some text back from a database and i noticed a problem. If someone puts a lot of characters in a row ie(xxxxxxxxxxxxxxxxxfkljsadjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjlassssssssssssssssssssssaaaaaaaaaaaaaaaaaaalllllllllllllllllllll), its causing the table cell to get longer and longer and longer. is there some code that will make it do a line break so it doesnt make my 500px wide table cell 15000px long?? anyone understand what im sorta saying? Link to comment https://forums.phpfreaks.com/topic/210538-table-cell-too-large/ Share on other sites More sharing options...
Wolphie Posted August 12, 2010 Share Posted August 12, 2010 Add a class to the cell and use this CSS: td.cell { max-width: 100px; word-wrap: break-word; } You can make the cell width any value you like. Link to comment https://forums.phpfreaks.com/topic/210538-table-cell-too-large/#findComment-1098468 Share on other sites More sharing options...
Festy Posted August 13, 2010 Share Posted August 13, 2010 or just break the long string using 'nl2br' function. Link to comment https://forums.phpfreaks.com/topic/210538-table-cell-too-large/#findComment-1098742 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.