td textarea高度自适应

//td 可填
.content{
word-wrap:break-word;
word-break:normal;
max-width: 240px;
}
<td class='content' contentEditable='true'></td>




textarea 高度自适应

$('textarea').each(function () {
this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
}).on('input', function () {
this.style.height = 'auto';
this.style.height = (this.scrollHeight) + 'px';
});
posted @ 2020-06-18 15:50  Leduo  阅读(896)  评论(0编辑  收藏  举报