0

I need to make the td overflow go into multiple lines as textarea.

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

1
  • put <br/> tag for next line. Commented Jan 14, 2016 at 11:23

2 Answers 2

1

Wrapping of text works when whitespaces are found in the text, the text you have written in the td above doesn't have any whitespaces, please add whitespaces and then it will start flowing on multiple lines.

Sign up to request clarification or add additional context in comments.

8 Comments

how to hide the bottom scroll ?
@Raviteja You can add overflow-x: hidden; for that. Please check the updated fiddle here: jsfiddle.net/huewy6r8/2
height is increasing if the text overflows here scroll should appear
isn't that what you require for your td? To flow text on multiple lines like textarea
for textarea a vertical scroll appears right ? If the text overflows
|
0

That is due to your text. There is no whitspace in your text. just add some white space in your text You can check the fiddler 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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.