当前位置:网站首页>PHP \ newline cannot be output
PHP \ newline cannot be output
2022-07-07 10:33:00 【zhang-php】
From the interface json Array , There is a newline in the text part of the array , use json_decode turn php After array , Output in html The page didn't wrap , At first, I thought that the newline symbol was deleted after the array was converted , Later, I tried various methods to replace characters , Finally, we found one CSS style :
white-space Property specifies how whitespace within an element is handled , The default value is normal( Blank will be ignored by browser )
Property value
value | describe |
---|---|
normal | Default . Blank will be ignored by browser . |
pre | Blank space will be reserved by browser . It behaves in a similar way HTML Medium <pre> label . |
nowrap | Text does not wrap , The text will continue on the same line , Until I met <br> Label until . |
pre-wrap | Keep blank sequence , But wrap normally . |
pre-line | Merge whitespace sequence , But keep line breaks . |
inherit | Rules should be inherited from the parent element white-space The value of the property . |
<td style="white-space:pre-wrap">{$vo.content}</td>
After adding this attribute, the line will wrap automatically
边栏推荐
- 嵌入式工程师如何提高工作效率
- Prototype object in ES6
- Gym installation pit records
- IIC基本知识
- 小程序跳转H5,配置业务域名经验教程
- The mobile terminal automatically adjusts the page content and font size by setting rem
- 搭建物联网硬件通信技术几种方案
- Kotlin realizes wechat interface switching (fragment exercise)
- Multithreaded asynchronous orchestration
- 南航 PA3.1
猜你喜欢
ThreadLocal is not enough
Trajectory planning for multi-robot systems: Methods and applications 综述阅读笔记
搭建物联网硬件通信技术几种方案
P1031 [NOIP2002 提高组] 均分纸牌
1324:【例6.6】整数区间
MONAI版本更新到 0.9 啦,看看有什么新功能
Smart city construction based on GIS 3D visualization technology
使用 load_decathlon_datalist (MONAI)快速加载JSON数据
Prototype and prototype chain
String formatting
随机推荐
5个chrome简单实用的日常开发功能详解,赶快解锁让你提升更多效率!
Talking about the return format in the log, encapsulation format handling, exception handling
High number_ Chapter 1 space analytic geometry and vector algebra_ Quantity product of vectors
使用 load_decathlon_datalist (MONAI)快速加载JSON数据
Guid primary key
深入理解Apache Hudi异步索引机制
[daiy5] jz77 print binary tree in zigzag order
电表远程抄表拉合闸操作命令指令
C logging method
Multithreaded asynchronous orchestration
ArrayList thread insecurity and Solutions
Schnuka: machine vision positioning technology machine vision positioning principle
Why is the reflection efficiency low?
施努卡:机器人视觉抓取工作原理 机器视觉抓取
Prototype object in ES6
Basic introduction of yarn and job submission process
555电路详解
Study summary of postgraduate entrance examination in November
【华为机试真题详解】高矮个子排队
【HigherHRNet】 HigherHRNet 详解之 HigherHRNet的热图回归代码