Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 如何在引导程序中的表单元格上获得一些填充?_Twitter Bootstrap_Ruby On Rails 4 - Fatal编程技术网

Twitter bootstrap 如何在引导程序中的表单元格上获得一些填充?

Twitter bootstrap 如何在引导程序中的表单元格上获得一些填充?,twitter-bootstrap,ruby-on-rails-4,Twitter Bootstrap,Ruby On Rails 4,我将CSS引导添加到rails4应用程序中。这似乎已将表格单元格的填充设置为0,使文本紧靠边框。当我尝试添加一些边框间距时,单元格内的文本被包裹,而不是表格增长以容纳文本。以下是我试图解决的问题: 就代码而言,这里是使用引导类生成HTML的HAML %table.table-striped.table-bordered %thead %tr.header %th Date %th Name %th Reading %th Reader

我将CSS引导添加到rails4应用程序中。这似乎已将表格单元格的填充设置为0,使文本紧靠边框。当我尝试添加一些边框间距时,单元格内的文本被包裹,而不是表格增长以容纳文本。以下是我试图解决的问题:

就代码而言,这里是使用引导类生成HTML的HAML

%table.table-striped.table-bordered
  %thead
    %tr.header
      %th Date
      %th Name
      %th Reading
      %th Reader
      %th Comments
  %tbody
    - @readings.each do |reading|
      %tr
        %td= reading.date
        %td= reading.name
        %td= reading.reading
        %td= reading.reader.nil? ? '(unassigned)' : reading.reader.name
        %td= reading.comments
        %td= link_to 'Show', reading_path(reading)
        %td= link_to 'Edit', edit_reading_path(reading)
根据Chrome的“检查元素”,有人把

media="all"
td, th {
    padding: 0;
}
在我的application.css中,但这在我的源代码中没有出现,因此我认为这应该归因于:

@import "bootstrap-sprockets";
@import "bootstrap";

你可以添加一些css

#verses td {
  .padding: 15px;
}
在您的html.haml中,我喜欢向表中添加一个id,这样它不会影响所有表(除非您愿意)

似乎有另一个css类覆盖了引导填充,因为默认值不是0。如果您需要另一个正在破坏填充的css,而这不起作用,您可以使用
!重要信息
,它应该可以工作

#verses td {
  .padding: 15px !important;
}

如果您添加一些
代码
,以便我们可以分析查看我的编辑,这将非常有用;引导程序中的某些内容似乎实际设置了“0”。我很确定引导程序不会这样做。。。我的css.sass中有相同的@imports,但它不是这样的。一定还有别的事。我必须完全删除另一个项目上的所有其他css,然后逐个模块添加,直到找到它。(这不是我最初的计划
#verses td {
  .padding: 15px !important;
}