Home>Article>Web Front-end> How to display html table without line breaks

How to display html table without line breaks

藏色散人
藏色散人 Original
2021-04-12 10:08:05 3797browse

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;

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;

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!

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