Home >Web Front-end >HTML Tutorial >td displays up to 2 lines_html/css_WEB-ITnose
The bound data may be less than 2 lines or more than 2 lines. If it is larger than two lines, let the part larger than two lines not be displayed, and only fill the two lines
in the background Make a judgment and write it. Use the ternary operator rows.count>2 "Display part": display all
and judge and write in the background. Use the ternary operator rows.count>2 "Display part": display all
CSS can solve the problem of automatic line wrapping when the width exceeds word-wrap:break-word; word-break:break-all;
First fix the width and height, and then judge whether the number of words is exceeded based on the number of bytes
Use overflow:hidden; text-overflow:ellipsis; and replace it with ellipses.