一定宽度表格内怎么“很好”的控制字符数量

一定宽度表格内如何“很好”的控制字符数量?
<td> 内有一定文字,我想文字过多(到边界)就不再显示。

但用Left或LeftB函数的话,也无法很好的控制,因为中文英文在内存中都占两个字节,但屏幕占用的相素数却不一样

请问怎么解决?

------解决方案--------------------
<style>
pre {width:300px;height:20px;overflow:hidden;text-overflow:ellipsis;background:#FFCC00;}
</style>
<td> <pre> 也无法很好的控制,因为中jsefhweuwweubneef文英文在内存中都占两个字节 </pre> </td>
------解决方案--------------------
Function InterceptString(txt,length)
txt=trim(txt)
x = len(txt)
y = 0
if x > = 1 then
for ii = 1 to x
if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) > 255 then '如果是汉字
y = y + 2
else
y = y + 1
end if
if y > = length then
txt = left(trim(txt),ii) '字符串限长
exit for
end if
next
InterceptString = txt
else
InterceptString = " "
end if
End Function
------解决方案--------------------
text-overflow:ellipsis是最好的方法(ie6++ff可以 )
------解决方案--------------------
/*************************************************
函数名:gotTopic
作 用:截字符串,汉字一个算两个字符,英文算一个字符
参 数:str ----原字符串
strlen ----截取长度
返回值:截取后的字符串
*************************************************/
function gotTopic($str,$strlen){
if($str== " "){
$gotTopic= " ";
exit;
}
$str=preg_replace(preg_replace(preg_replace(preg_replace($str, "&nbsp; ", " "), "&quot; ",chr(34)), "&gt; ", "> "), "&lt; ", " < ");
$l=strlen($str);
$t=0;
/*for($i=1; $i <=$l; $i++){
$c=abs(asc(substr($str,$i,1)));//acs()
if($c> 255){
$t=$t+2;
}else{
$t=$t+1;
}*/
if($l> =$strlen){
$gotTopic=substr($str,0,$i) . "… ";
exit;
}else{
$gotTopic=$str;
}
//}
return preg_replace(preg_replace(preg_replace(preg_replace(gotTopic, " ", "&nbsp; "),chr(34), "&quot; "), "> ", "&gt; "), " < ", "&lt; ");
}