그거/Tech

css로 문자열 길이 잘라내기

뽀기 2007. 7. 31. 16:54


 아래와 같이 하면 된다!

white-space:nowrap; text-overflow : ellipsis; overflow : hidden;


<TABLE style="TABLE-LAYOUT: fixed" cellSpacing=1 cellPadding=0 bgColor=#000000 border=1>
<TR bgColor=#ffffff>
 <TD style="OVERFLOW: hidden; WORD-BREAK: break-all; WHITE-SPACE: nowrap; TEXT-OVERFLOW: ellipsis" width=100>
 
<nobr>
  This is a test hahaha merong good good good
 
</nobr>
 </TD>
</TR>
</TABLE>

그러면

This is a test hahaha merong good good good

이랬던 테이블이

This is a test hahaha merong good good good

이렇게 변한닷.