2
,但我想這樣做使用Javascript或jQuery的任何人都可以告訴我怎麼做這件事情。添加TextArea和colspan設爲動態創建我有以下的硬編碼的表數據</p> <pre><code><td colspan="4"> <textarea rows="4" cols="40"></textarea> </td> </code></pre> <p>錶行
,但我想這樣做使用Javascript或jQuery的任何人都可以告訴我怎麼做這件事情。添加TextArea和colspan設爲動態創建我有以下的硬編碼的表數據</p> <pre><code><td colspan="4"> <textarea rows="4" cols="40"></textarea> </td> </code></pre> <p>錶行
只要做到這一點。
var td = document.createElement('td');
td.setAttribute('colspan', '4');
var textarea = document.createElement('textarea');
textarea.setAttribute('rows', '4');
textarea.setAttribute('cols', '40');
td.appendChild(textarea);