如果我進入冗長的文字在textarea的與沒有空格我追加,它擾亂DIV的對準和文本顯示在單行。如何在帶固定寬度的DIV中控制這種類型的文本?文本的對齊的DIV(有沒有空格TEXT)
這裏是我的DEMO:
也看看這個圖片,只是想說明我的問題更好的辦法。
我在這裏提供的代碼太多或進入我的jsfiddle DEMO
這裏是我的HTML:
<table border="0" width="500" cellspacing="0">
<tbody class="append_data"></tbody>
<tr>
<td>
<textarea name="description" id="description"></textarea>
<p>
<a href="javascript:void(0);" class="add_more">Add More</a>
</p>
</td>
</tr>
</table>
這裏是CSS:
#description{
width:400px;
}
.description_text{
border:#333333 solid 1px;
width:400px !important;
}
這裏是我的js代碼:
$('.add_more').click(function()
{
var description = $('#description').val();
$(".append_data").append('<div class="description_text">'+description+'</div><br><br>');
});