0

我需要使td overflow作爲textarea進入多行。當空格在文本中發現如何使td溢出進入多行?

HTML

<table class="table"> 
    <tr> 
    <td>Jill</td> 
    <td style="max-width:200px;overflow-y:scroll;">Smithasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf</td> 
    <td>50</td> 
    </tr> 
    <tr> 
    <td>Eve</td> 
    <td>Jackson</td> 
    <td>94</td> 
    </tr> 
</table> 

Fiddle here

+0


標記下一行。 –

回答

1

文字的包裝工作,你都寫在上面的td文本沒有任何空格,請加空格然後它將在多條線上開始流動。

+0

如何隱藏底部滾動條? – Raviteja

+0

@Raviteja您可以爲此添加'overflow-x:hidden;'。請檢查更新的小提琴在這裏:https://jsfiddle.net/huewy6r8/2/ –

+0

如果文本溢出[這裏](https://jsfiddle.net/huewy6r8/3/)滾動應該出現高度增加 – Raviteja

0

這是由於您的文字。文字中沒有whitspace。只需添加您的文字一些白色的空間,您可以檢查提琴手here

<table class="table"> 
     <tr> 
     <td>Jill</td> 
     <td style="max-width:200px;overflow-y:scroll;"> 
     Smithasdfas 
     dfasdfasdfasdfa sdfasdfasdfasdfasdfasdfasdfasdfasd 
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf 
</td> 
     <td>50</td> 
     </tr> 
     <tr> 
     <td>Eve</td> 
     <td>Jackson</td> 
     <td>94</td> 
     </tr> 
    </table>