Forcing line breaks in table entries?

They have: 135 posts

Joined: Apr 2000

This is for work...not the site in my sig, hence I can't just recode the whole thing...

I have table cells whose data contains unbroken strings too long for the desired width. Of course, the column gets displayed wider than it should and messes up the rest of the table.

The data is pulled from a database, and I cannot change the data itself and put spaces in the offending strings, as this will mess up other things in the system . Since the <td> tag has a "nowrap" property, isn't there some sort of "wrap" property? I wouldn't mind the string being broken up in the middle, wherever it gets too long for the cell width...

I'm writing in Cold Fusion, however I don't see any CF function to handle this either.

------------------
http://www.RewardsLookup.com

They have: 231 posts

Joined: Feb 2000

The only thing you can do is split your string. Use CF to do this.

They have: 89 posts

Joined: Sep 1999

There is a CF custom tag called CF_ForceWrap that will do exactly what you want. It forces line breaks within any CF string variable at whatever position you want. Here is the link.
http://devex.allaire.com/developer/gallery/info.cfm?ID=CA3473E1-2830-11D4-AA9700508B94F380&method=Full

You could also do this with some tweeking of the string using the right and left functions, but that would be harder.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.