How to display html table without line breaks

藏色散人
Release: 2021-04-12 10:08:05
Original
3877 people have browsed it

How to realize table display without line breaks: First open the corresponding HTML code file; then add the style "word-break: keep-all;word-wrap:break" to "td,th" under the table -word;" can achieve the effect of display without line breaks.

How to display html table without line breaks

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.

The effect of displaying no line breaks in the table of html

In the table, if you need no line breaks in the cells, add styles to td and th under the table

word-break: keep-all;
word-wrap:break-word;
Copy after login

word -break: keep-all; In this case, there will be no line wrapping in Chinese.

word-wrap:break-word; English will not wrap.

If there are spaces in the middle, at the spaces By default, it will wrap. If you need not to wrap, use the following style

white-space: nowrap;
Copy after login

In this case, there is generally no need to set the width in the table. The table will automatically adjust according to the content

[Recommended learning: HTML video tutorial

The above is the detailed content of How to display html table without line breaks. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template