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

Take you to understand MySQL character set settings in 5 minutes

Table of contents 1. Content Overview 2. Concepts...

The implementation of Youda's new petite-vue

Table of contents Preface Introduction Live Easy ...

Introduction to /etc/my.cnf parameters in MySQL 5.7

Below are some common parameters of /etc/my.cnf o...

A few things about favicon.ico (it’s best to put it in the root directory)

Open any web page: for example, http://www.baidu....

Example code for implementing complex table headers in html table

Use HTML to create complex tables. Complex tables...

How to calculate the value of ken_len in MySQL query plan

The meaning of key_len In MySQL, you can use expl...

Summary of some common techniques in front-end development

1. How to display the date on the right in the art...

Instructions for nested use of MySQL ifnull

Nested use of MySQL ifnull I searched online to s...

Description of meta viewport attribute in HTML web page

HTML meta viewport attribute description What is ...

Common rule priority issues of Nginx location

Table of contents 1. Location / Matching 2. Locat...

Advanced and summary of commonly used sql statements in MySQL database

This article uses examples to describe the common...

Detailed explanation of basic data types in mysql8.0.19

mysql basic data types Overview of common MySQL d...

Web page creation basic declaration document type description (DTD

Using CSS layout to create web pages that comply w...