td content automatically wraps table table td after setting the width too much text automatically wraps

td content automatically wraps table table td after setting the width too much text automatically wraps
Set the table's style="table-layout:fixed;" and then set the td's style="word-wrap:break-word;"

Copy code
The code is as follows:

<table style="TABLE-LAYOUT: fixed" border="1" cellspacing="0" cellpadding="0" width="200">
<tbody>
<tr>
<td style="WORD-WRAP: break-word" width="20">sssssssssssssssssssssssssssssssssssssssssssssssssssssssss </td>
<td>aaaaa</td>
</tr>
<tr>
<td style="WORD-WRAP: break-word" width="20">sssssssssssssssssssssssssssssssssssssssssssssssssssssssss </td>
<td>aaaaa</td>
</tr>
</tbody>
</table>

<<:  Drop-down menu and sliding menu design examples

>>:  CSS style solves the problem of displaying ellipsis when the text is too long

Recommend

A bug fix for Tomcat's automatic shutdown

Preface Recently, a Java EE web project that has ...

The easiest way to make a program run automatically at startup in Linux

I collected a lot of them, but all ended in failu...

Pure CSS to achieve the water drop animation button in Material Design

Preface You should often see this kind of special...

How to use Nginx to proxy multiple application sites in Docker

Preface What is the role of an agent? - Multiple ...

The url value of the src or css background image is the base64 encoded code

You may have noticed that the src or CSS backgroun...

The difference between br and br/ in HTML

answer from stackflow: Simply <br> is suffic...

MySQL8.0.18 configuration of multiple masters and one slave

Table of contents 1. Realistic Background 2. Agre...

How to query a record in Mysql in which page of paging

Preface In practice, we may encounter such a prob...

Detailed explanation of virtual DOM in Vue source code analysis

Why do we need virtual dom? Virtual DOM is design...