Thierry Posted October 25, 2007 Share Posted October 25, 2007 Sometimes when I get a set of results in a table a column value can be much longer then the table column. I don't want it to wrap into multiple lines as I want it to remain at the same height of a single row. Instead if its too long I want to cut it and add three points (This is way too looooooooooo...) to signify it has been cut but that the row still remains at the same height. I cant use fixed widths (substring or the like) as the table uses percentages and thus scales differently on different resolutions. Anything that could help me out? Quote Link to comment https://forums.phpfreaks.com/topic/74712-wrappingcutting-words-in-a-table/ Share on other sites More sharing options...
Zane Posted October 25, 2007 Share Posted October 25, 2007 SELECT IF(LENGTH(yourCol)>30,CONCAT(SUBSTRING(yourCol,1,30),'....'),yourCol) as theColumn FROM tableX see how that works Quote Link to comment https://forums.phpfreaks.com/topic/74712-wrappingcutting-words-in-a-table/#findComment-377692 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.