Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to change textarea height if appended table row is bigger than previous row?
    text
    copied!<p>I have a jsfiddle here: <a href="http://jsfiddle.net/XM8hG/33/embedded/result/" rel="nofollow">http://jsfiddle.net/XM8hG/33/embedded/result/</a></p> <p>To view code of fiddle click here: <a href="http://jsfiddle.net/XM8hG/33/" rel="nofollow">http://jsfiddle.net/XM8hG/33/</a></p> <p>To use the fiddle follow steps below:</p> <ol> <li><p>At the top click on the open grid and select button 3, then click on "Add Question" button to append the row in the table underneath, you can see that the textarea fills the table cell.</p></li> <li><p>Now back at the top click on open grid again but this time select button 26 then click on "Add Question" button to append the row in the table underneath, you can see that the textarea does not fill the table cell. This is because it takes up more space and table cell has increased.</p></li> </ol> <p>Now if you refresh the fiddle and reverse the steps so you did step 2 first then step 1, you will see the textarea in both table cells fill the rows because the first table row is bigger than the second table row.</p> <p>But what do I need to include in code below in order to be able to achieve the reverse solution so that if last table row is smaller, then the textarea should be able to fill the table cell in the next row if row is bigger?</p> <p>Below is the main code which is commented in fiddle in order to fill textarea to table cell when option changes:</p> <pre><code>//CHANGE TEXTAREA HEIGHT var _x = $(e.currentTarget); var _y = _x.closest('td.extratd'); var _z = _y.prev(); $('textarea', _z).css('height', '').height(_z.innerHeight()) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload