当前位置:网站首页>php \n 换行无法输出
php \n 换行无法输出
2022-07-07 08:13:00 【zhang-php】
从接口拿到的json数组,数组中文字部分有换行,用json_decode转php数组后,输出在html页面竟然没有换行,一开始我以为是转数组后换行符号被删除了,后面用字符替换各种办法试了一遍,最后搜到了一个CSS样式:
white-space属性指定元素内的空白怎样处理,默认值normal(空白会被浏览器忽略)
属性值
| 值 | 描述 |
|---|---|
| normal | 默认。空白会被浏览器忽略。 |
| pre | 空白会被浏览器保留。其行为方式类似 HTML 中的 <pre> 标签。 |
| nowrap | 文本不会换行,文本会在在同一行上继续,直到遇到 <br> 标签为止。 |
| pre-wrap | 保留空白符序列,但是正常地进行换行。 |
| pre-line | 合并空白符序列,但是保留换行符。 |
| inherit | 规定应该从父元素继承 white-space 属性的值。 |
<td style="white-space:pre-wrap">{$vo.content}</td>加完这个属性之后就自动换行了

边栏推荐
- .NET配置系统
- Methods of adding centerlines and centerlines in SolidWorks drawings
- Postman interface test III
- IPv4 socket address structure
- 电表远程抄表拉合闸操作命令指令
- The request object parses the request body and request header parameters
- Some test points about coupon test
- [sword finger offer] 42 Stack push in and pop-up sequence
- PDF文档签名指南
- Wallys/IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL CONCURRENT
猜你喜欢

Serial communication relay Modbus communication host computer debugging software tool project development case
![[higherhrnet] higherhrnet detailed heat map regression code of higherhrnet](/img/3c/890f2481231482645554f86dd614a9.png)
[higherhrnet] higherhrnet detailed heat map regression code of higherhrnet

STM32 Basics - memory mapping

每周推荐短视频:L2级有哪些我们日常中经常会用到的功能?

XML configuration file parsing and modeling

IO模型复习

高数_第1章空间解析几何与向量代数_向量的数量积

How to cancel automatic saving of changes in sqlyog database

Postman interface test VII

LLVM之父Chris Lattner:為什麼我們要重建AI基礎設施軟件
随机推荐
搭建物联网硬件通信技术几种方案
Vs code specifies the extension installation location
2022.7.4DAY596
The method of word automatically generating directory
关于hzero-resource报错(groovy.lang.MissingPropertyException: No such property: weight for class)
Easyexcel read write simple to use
Wallys/IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL CONCURRENT
Kotlin实现微信界面切换(Fragment练习)
[ORM framework]
ORM -- query type, association query
Differences between MCU and MPU
STM32 ADC and DMA
ES6中的函數進階學習
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
Bit operation ==c language 2
Fiddler break point
Programming features of ISP, IAP, ICP, JTAG and SWD
嵌入式工程师如何提高工作效率
The request object parses the request body and request header parameters
Guide de signature du Code Appx