Topic: (advanced?) cutting of subject names to fit a certain table width

Is there a way to cut a subject string to fit a certain table width?

I use Verdana alt Arial as fonts.

I want this:

"A long subject that will be cut becouse its to long to fit"
=> "A long subject that wi ..."

That is no big deal to do, BUT I think this is:
Since this forum uses Verdana also you notice the diffrence in these chars (both rows have 10 chars each):

aaaaaaaaaa
mmmmmmmmmm

This means I cant set a max width that fills the whole available table width i have (about 160px) and still avoid the table being streched if someone creates a thread containing "mmmmmmmmmmmmmmm" for example.

This is how it could look like if I cut after 17 chars. The table width is OK, but only the "mmmmmmm..." uses the entire space available:

http://garaget.org/temp/prob.jpg

Is there some way to fix this?

2 (edited by Paul 2004-12-11 20:41)

Re: (advanced?) cutting of subject names to fit a certain table width

PunBB 1.2 works like that automatically with messages and could be made to crop subjects as well. It is trickier for PunBB 1.1.5 because tables have trouble with overflow:hidden but I will give it some thought.

The answer generally is to put the subject in a div then in the stylesheet give it a fixed width and set overflow to hidden.