Вывожу в таблице в инпуты значения из бд.
<td><input class="form-control" type="text" name="doc_publish" value="<?=htmlspecialchars($users['doc_publish'], ENT_QUOTES)?>" id="example-text-input"></td>
Как сделать так, чтобы данные показывались целиком? Может перенос строки сделать как-то...
В нативном инпуте перенос строки сделать невозможно, используйте для многострочных данных textarea:
textarea{
display:block;
height: 100px;
width:90%;
}
<textarea class="form-control" id="example-text-input" name="doc_publish">
<?=htmlspecialchars($users['doc_publish'], ENT_QUOTES)?>
</textarea>
$('textarea').on('paste input', function () {
if ($(this).outerHeight() > this.scrollHeight){
$(this).height(1)
}
while ($(this).outerHeight() < this.scrollHeight + parseFloat($(this).css("borderTopWidth")) + parseFloat($(this).css("borderBottomWidth"))){
$(this).height($(this).height() + 1)
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<body>
<textarea id="txtInput"></textarea>
</body>
Продвижение своими сайтами как стратегия роста и независимости