![](/img/trans.png)
[英]Bootstrap - How can I reduce the width of input text (type=number) control to N number of digit spaces
[英]How can I accept the data from database which has new lines and 'n' number of spaces in it?
我有一個數據庫,該數據庫具有帶有“ TEXT”數據類型的“ data”列。 所以我想獲取具有新行數據的行(例如我喜歡烹飪)以及空格數(例如我正在烹飪)。 我喜歡做飯時就得到輸出.....我正在做飯。 我知道html忽略了空格和換行符,因此我們需要使用&nbsp進行處理...但是,當數據量很大時,應用&nbsp可能很麻煩。 有人可以建議任何解決方法嗎? 我非常感謝您的回答。
您應該使用white-space: pre
表示需要的元素。 並且您的HTML代碼應位於帶有ID名稱的特定框中,如下所示:
<div id='test'>
// anything
<div>
然后對於CSS://表和鏈接
#test tr, #test a{white-space: pre;}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.