Textarea换行

时间:2017-01-27 11:00:28

标签: php html css

我将描述数据从textrea字段存储到数据库。问题是当我写一个没有换行符的长行文本时,它会将相同的内容存储到数据库中。我需要防止换行取决于textarea宽度... example

输出从容器出来...... enter image description here

1 个答案:

答案 0 :(得分:3)

如果我正确地理解了你的问题,那就是输出打破了你把它放入的div - 这使得它成为CSS问题,而不是PHP问题。

您可以使用Sub Summary() Dim MasterBook As Workbook Set MasterBook = ActiveWorkbook With MasterBook Dim rng As Range Set rng = Range("B:B") End With Dim TemplateBook As Workbook Set TemplateBook = Workbooks.Open(Filename:="C:\Users\Desktop\Example template.xlsx") Dim cell As Range For Each cell In rng If cell.Value = "Red" Then cell.Offset(0, -1).Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True TemplateBook.Sheets("Red").Copy ActiveSheet.paste ElseIf cell.Value = "Blue" Then cell.Offset(0, -1).Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True TemplateBook.Sheets("Blue").Copy ActiveSheet.paste End If Next cell End Sub CSS属性,如果超过容器宽度,则会破坏这些字词。

word-wrap: break-word;
.break {
    word-wrap: break-word;
    width: 100px;
    background: lightgray;
}