html - 我的文本区域干扰了表格中的其他 td 元素

标签 html css

这是示例代码:

<table>
      <tr>
       <td>
         Distrubed td element number 1
       </td>
       <td>
         Distrubed td element number 2
       </td>
       <td>
         Distrubed td element number 3
       </td>
      </tr>
      <tr>
       <td colspan="3"> // sorry forgot to type
        <form method="post">
         <textarea>The one who causing disturbance</textarea>
          <button>Sample</button>
        </form>
       </td>
      </tr>
    </table>

问题是,每当我调整 textarea 元素 的大小时,上述 td 元素也会进行调整。尽管我的代码还没有 css。我只想知道这是什么原因。错误或编码本身。谢谢!

最佳答案

最好为文本区域指定 cols。这将解决您的问题。

例如;

<textarea cols="20">The one who causing disturbance</textarea>

关于html - 我的文本区域干扰了表格中的其他 td 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37657077/

相关文章:

html - 非常基本的 HTML 页面不会显示

javascript - 投票/评分系统 : How to fail gracefully when javascript isn't supported/enabled?

javascript - 如何选择多个行值

html - 如何为手机拨号屏幕创建href?

jquery - 如何使用 jquery 更改同一类的多个文本的字体大小和字体系列

Javascript 在文本中查找单词并动态改变颜色

javascript - jQuery Bounce Effect on click 没有 jQuery UI

javascript - 溢出:隐藏但让内容自动滚动

javascript - jQuery: For 循环 if else 和 nth-child

css - webkit 和 moz 中的布局问题