|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
heohni Smarty Regular
Joined: 20 Sep 2006 Posts: 40
|
Posted: Mon Nov 26, 2007 8:37 am Post subject: Count words problem |
|
|
Hi.
strange thing:
I have the case, that I need to put a break into a string after a certain lenght.
I was using count_characters to get the string length.
Pitty is, that my string has for example 31 chars, but depending of the fact what letters (how many capitals and lower-case characters) I use, the break sometimes does apear, when it's not needed.
Does anyone know about a method to check how many pixels a string takes?
In order to say something like: "if the string is greater or equal 200px do the break"
Hope to find here some good ideas!
Thanks
Heohni |
|
Back to top |
|
Celeb Administrator
Joined: 17 Apr 2007 Posts: 1025 Location: Vienna
|
Posted: Mon Nov 26, 2007 11:15 am Post subject: |
|
|
The only way I can think of would be to give the HTML element the text is in a fixed lenght and let the browser do the line breaking for you. _________________ Darn computers always do what I tell them to instead of what I want them to do. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|