html - 使输入字段看起来像 bootstrap 3 中的表格单元格

标签 html css twitter-bootstrap twitter-bootstrap-3 html-table

我在 bootstrap 3 中有一个表

<table class="table table-bordered table-condensed">
    <tbody>
        <tr>
           <td><input type="text" class="form-control" /></td>
           <td><input type="text" class="form-control" /></td>
           <td><input type="text" class="form-control" /></td>
           <td><input type="text" class="form-control" /></td>
           <td><input type="text" class="form-control" /></td>
           <td><input type="text" class="form-control" /></td>
        </tr>
    </tbody>
</table>

我可以让输入字段看起来像普通单元格吗?我希望输入字段填满整个单元格(没有输入边距或表格单元格填充)。就像 Excel 电子表格,我有很多单元格并且可以在每个单元格中写入。

最佳答案

是的。这样做:

input {display: block; padding: 0; margin: 0; border: 0; width: 100%;}
td {margin: 0; padding: 0;}

fiddle :http://jsbin.com/biqomurafage/1

关于html - 使输入字段看起来像 bootstrap 3 中的表格单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25626789/

相关文章:

html - 为什么使用本地服务器时 HTML 标记的宽度更小?

javascript - 确定中心

jQuery SlideDown 子菜单上边距

jquery - 文本在新的 Bootstrap 轮播幻灯片上淡入/淡出

javascript - 将 div 附加到搜索文本框以创建类似 Gmail 的搜索框

html - 有没有办法让 CSS 选择器在标题前放置 "-"?

html - 为交替的 <DIV> 行提供背景

javascript - 如何在 HTML5 中读取内联 SVG 中的自定义命名空间节点?

html - 显示 : inline-block; and text-overflow: ellipsis; 的有序列表中的列表项未显示数字

javascript - 为了将轮播集成到 Bootstrap 页面中,我必须做什么