Home >Web Front-end >HTML Tutorial >How to deal with this special Table style line wrapping problem._html/css_WEB-ITnose
What I want to achieve is that if the content in cell td is very long, it will not wrap into new lines but expand the grid.
But every time the control I use is generated, there will be an extra style like table-layout: fixed , cannot be implemented, so every time I modify the style table-layout:auto; through js, it seems too troublesome. Is there any other way to deal with it, because table-layout:fixed is generated by default in the control? Can't be removed, is it possible to add some styles to tr or td? Please advise
<table style="width:100%;table-layout:fixed;"><tr> <td>内容很长很长....</td></tr></table>
It should be added, but it won’t have much impact. When you write CSS, you must write it in c9ccee2e6ea535a969eb3f532ad9fe89 or in a css file. Then its priority will definitely be higher than the automatically generated 323afab867e9cf7b8a86d0ff023f98a1 style. Low, so the CSS here will still be executed in the end, and it should still be processed by js.
Personally, I think it is impossible to achieve.
If the table width is 100%, then its maximum width can only reach the width of the parent element. So Td can only reach that level.
This is the limitation of percentage.
Unless a specific and large enough value is added to the width attribute of Td, the table percentage limit will be broken.
What is said above cannot be achieved using CSS alone.
This can only be achieved by working with JS to modify the width value of TD.
In this case, it’s better not to use table
What does this mean?
6298a9006d21f903be06836cb33cd592
a34de1251f0d9fe1e645927f19a896e8
b6c5a531a458a2e790c1fd6421739d1cThe content is very long, the content is very long, the content is very long, the content is very long Very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long. Very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long. Very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long. Very long content very long very long content very long very long content very long very long content very long very long content very long very long....b90dd5946f0946207856a8a37f441edf
fd273fcf5bcad3dfdad3c41bd81ad3e5
f16b1740fad44fb09bfe928bcc527e08
It is enough if TD is not widened.
fcf78301a97ac31bc3c978f3cfe0b198
< ;caption>Annual income 2004-200737eb775bb5a9e6f3d094e96a76117fe8
a34de1251f0d9fe1e645927f19a896e8
b4d429308760b6c2d20d6300079ed38e01c3ce868d2b3d9bce8da5c1b7e41e5b
b4d429308760b6c2d20d6300079ed38e200401c3ce868d2b3d9bce8da5c1b7e41e5b
b4d429308760b6c2d20d6300079ed38e 200501c3ce868d2b3d9bce8da5c1b7e41e5b
b4d429308760b6c2d20d6300079ed38e200601c3ce868d2b3d9bce8da5c1b7e41e5b
b4d429308760b6c2d20d6300079ed38e200701c3ce868d2b3d9bce8da5c1b7e41e5b
fd273fcf5bcad3dfdad3c41bd81ad3e5
a34de1251f0d9fe1e645927f19a896e8
92aaf5f230a63a5abcc1ac8aabf29c41appropriationappropriationappropriationappropriationappropriationappropriationappropriationappropriationappropriationappropriationappropriationappropriationappropriationappropriationappropriation01c3ce868d2b3d9bce8da5c1b7e41e5b td>
b6c5a531a458a2e790c1fd6421739d1c9,700b90dd5946f0946207856a8a37f441edf
b6c5a531a458a2e790c1fd6421739d1c10,650b90dd5946f0946207856a8a37f441edf
fd273fcf5bcad3dfdad3c41bd81ad3e5
f16b1740fad44fb09bfe928bcc527e08
Just don’t add width restrictions on tr