With the increasing popularity of W3C, many websites are transforming traditional tables into DIV + CSS la S. When I study some features of CSS and DIV, I found an interesting CSS. After a series of research and experiments, I found an alternative method to implement this function using DIV + CSS. This method is no problem in my tests, it is well compatible with various codes and mixed Chinese and English.
Method in Div:<Div style = "width: 200px; border: 1px dashed red; overflow: hidden; text-overflow: ellipsis">
Method In Table:<TABLE style = "table-layout: fixed; border-collapse: collapse; font-size: 12px;" border = "1" width = "200" bordercolor = #666666>
The code is very simple. It should be easy to understand, mainly because of the "text-overflow" attribute, which has two values: "ellipsis" and "clip ", simply put, the first value will be appended with a ellipsis at the end of the text after the interception, and the second value will not.
At present, I have not found any bugs in this method. CSS control will not cause too much overhead. Self-feeling is a useful method!