简体   繁体   English

如何使输入标签充满整个 <td> 在带有Bootstrap的表中

[英]how to make input tag fill a whole <td> in a table with Bootstrap

Good morning, 早上好,

code here : http://jsbin.com/uhuqog/4/ 此处的代码: http : //jsbin.com/uhuqog/4/

In a table , when clicking on a <td> with .editable class, the original content of this <td> is replaced by an <input type="text"> with the original content as the value . table ,当单击具有.editable类的<td>时,此<td>的原始内容将替换为以原始内容为value<input type="text"> I would like the input tag to have the same size of the original <td> . 我希望输入标签具有与原始<td>相同的大小。 I tried to remove some margin and padding applied to the input tag but it didn't work and the <td> 's height and width change when changing input's height and width. 我尝试删除一些应用于输入标签的边距和填充,但是它不起作用,并且在更改输入的高度和宽度时<td>的高度和宽度也会发生变化。

I chose a different approach. 我选择了另一种方法。

When the <td> is clicked, I calculate its absolute position, its width and height and I place the input above it. 单击<td> ,我将计算其绝对位置,其宽度和高度,并将输入放置在其上方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM