Home  >  Article  >  Web Front-end  >  How to solve the problem of too long td? CSS to expand the fixed-width table (picture and text)

How to solve the problem of too long td? CSS to expand the fixed-width table (picture and text)

不言
不言Original
2018-07-26 09:40:102630browse

The content of this article is about how to solve the problem of too long td? CSS realizes the expansion of a fixed-width table (pictures and texts). The content is very detailed. Friends in need can refer to it. I hope it can help. You guys.

Solution:

Add style to the table: 

table{table-layout:fixed;word-break:break-all}

table-layout:fixed The column width of tablle is set by the table width and column width.
word-break:break-all Allows line breaks within words.

Under normal circumstances:

## The td in the table is too long:

##After adding the style:


Related recommendations:

How to hide HTML elements using CSS? Four ways to hide HTML elements

How to implement responsive navigation menu with css and js

The above is the detailed content of How to solve the problem of too long td? CSS to expand the fixed-width table (picture and text). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn