使用PHP修剪字符串的空白/制表符(Using PHP to trim white space/tab for a string)
根据上一个主题 ,我将修改PHP中的字符串的空格/制表符。
$html = '<tr> <td>A </td> <td>B </td> <td>C </td> </tr>'
转换为
$html = '<tr><td>A </td><td>B </td><td>C </td></tr>'
如何编写语句,如
str.replace(/>\s+</g,'><');
?According to the previous topic, I am going to trim white space/tab for a string in PHP.
$html = '<tr> <td>A </td> <td>B </td> <td>C </td> </tr>'
converting to
$html = '<tr><td>A </td><td>B </td><td>C </td></tr>'
How to write the statement likes
str.replace(/>\s+</g,'><');
?
原文:https://stackoverflow.com/questions/6906335
更新时间:2024-02-13 09:02
最满意答案
我已经更新了你的小提琴 ,结果它需要以下CSS代码才能正确对齐。 这只是在放大时将内容保持在左侧,这样就不会浪费空间,并且在不需要时不会显示滚动。
-webkit-transform-origin: top left; float:left;
I have updated your fiddle, turns out it needed the following CSS code for it to be aligned correctly. This just keeps the content to the left when zooming in so that there is no wasted space and the scroll does not show up when unwanted.
-webkit-transform-origin: top left; float:left;
相关问答
更多-
如果不需要,隐藏滚动条(Hide scrollbar in pre if not needed)[2023-07-27]
使用: overflow-x: auto; auto告诉浏览器如果内容超出框的宽度,将只显示滚动条。 Use: overflow-x: auto; auto tells the browser to only show a scrollbar if the content exceeds the width of the box. -
Qt.ScrollBarAsNeeded在实际需要时不显示滚动条(Qt.ScrollBarAsNeeded not showing scrollbar when it's actually needed)[2022-06-10]
一切似乎都按我的预期工作,而不需要任何解决方法。 但是,我强烈怀疑您的真实代码中还存在其他限制,您尚未在您的问题中发现这些限制。 UPDATE 下面是一个简单的例子,当滚动条被显示/隐藏时调整滚动条的大小: import sys from PyQt5 import QtCore, QtGui, QtWidgets class Window(QtWidgets.QMainWindow): def __init__(self): super(Window, self).__init__ ... -
您必须在Track IsDirectionReversed设置为true ,这是默认模板的作用。 You must set IsDirectionReversed to true on the Track, which is what the default templates does.
-
不需要时隐藏滚动条,但保持屏幕宽度一致(Hide scrollbar when not necessary, but keep the screen width consistent)[2024-04-12]
在这里尝试jQuery“完美滚动”插件是: http : //noraesae.github.io/perfect-scrollbar/ Try jQuery "perfect scroll" plugin here is: http://noraesae.github.io/perfect-scrollbar/ -
我已经更新了你的小提琴 ,结果它需要以下CSS代码才能正确对齐。 这只是在放大时将内容保持在左侧,这样就不会浪费空间,并且在不需要时不会显示滚动。 -webkit-transform-origin: top left; float:left; I have updated your fiddle, turns out it needed the following CSS code for it to be aligned correctly. This just keeps the content t ...
-
仅当滚动条位于顶部时,模态弹出窗口才会显示在中心(Modal pop up displays at the center only when the scrollbar is at the top)[2021-12-14]
而不是顶部:0左:0使用: #backgroundPopup{ display:none; position:fixed; height:100%; width:100%; top:50%; left:50%; background:#000000; border:1px solid #cecece; z-index:1; } 顶部:50%; 左:50%; 无论如何,都要将元素保留在页面的中心。 Instead of top:0 left:0 use: #backgroundPopup{ display: ... -
使html更高,滚动将显示 html { overflow-y: scroll; height: 101% } Make the html a bit higher and the scroll will show up html { overflow-y: scroll; height: 101% }
-
在动画CSS上隐藏滚动条(Hiding scrollbar on animating CSS)[2023-03-30]
在wrapper上设置transform: translateZ(0)修复了溢出问题 - 可能它与创建新堆栈上下文的转换有关。 现场演示: html, body { margin: 0; } .wrapper { width: 100vw; height: 100vh; overflow-x: hidden; transform: translateZ(0); } #slide { position: absolute; left: -40p ... -
底部滚动条(Bottom scrollbar)[2022-02-17]
你有position: relative; left: 50px; 在#menuToggle 。 这会将#menuToggle向右#menuToggle 50px,在窗口外面。 您可以改为使用该元素的边距。 删除top, left并添加margin: 50px 0 0 50px; https://codepen.io/anon/pen/NdGYyw You have position: relative; and left: 50px; on #menuToggle. That pushes #menuTo ... -
滚动条可以通过CSS在大多数浏览器中控制,但只有在您控制内容时才有用: html, body { overflow: auto; } 当然,WebBrowser控件是否符合这一点还有待观察。 请参阅http://www.w3schools.com/cssref/pr_pos_overflow.asp Scroll bars can be controlled in most browsers via CSS, though useful only if you have control of th ...