【问题标题】:how to remove borders for a particular table cells in html?如何删除html中特定表格单元格的边框?
【发布时间】:2015-10-14 00:42:18
【问题描述】:

我有以下标记。

<table class="table table-bordered table-stripped width_setting">
  <thead>
    <tr>
      <th>S.No</th>
      <th>Job Title</th>
      <th>Posted On</th>
      <th>Salary</th>
      <th colspan="3" class="remove_border_th"></th>
    </tr>
  </thead>

  <tbody>
    <% @jobpostings.each do |jobposting| %>
      <tr>
    <td><%= jobposting.S_No %></td>
    <td><%= jobposting.Job_Title %></td>
    <td><%= jobposting.Posted_On %></td>
    <td><%= jobposting.CTC %></td>
    <!-- <td><%#= link_to 'View Details', assessment %></td> -->
    <td class="no_border_2" ><%= link_to 'View Details',  jobposting, :target => "_blank" %>&nbsp;</td>
    <!-- <td><%#= link_to 'Apply', edit_assessment_path(assessment) %></td> -->
    <td class="no_border_1"><%= link_to 'Apply', :controller=>"job_applicants", :action=>"new", :title=> jobposting.Job_Title %>
      </tr>
    <% end %>
  </tbody>
</table>
</div>
<br>

<%= link_to "Home", :controller=>"jobpostings", :action=>"index" %> |<%= link_to "Logout", destroy_admin_session_path, :method => :delete %>


<style type="text/css">

    .width_setting {
  border: 1px solid #dddddd;
  width: 813px;
}
.no_border_2{
border-right:none !important;

border-bottom:none !important;

border-top: none !important;
}


.no_border_1{
border-right:none !important;
border-left:none !important;
border-bottom:none !important;
border-top: none !important;

}
.remove_border_th{
border-right:none !important;

border-bottom:none !important;
border-top: none !important;

}

</style>

我正在使用当前标记获得以下输出。

我想删除这些链接的单元格边框,View Details,apply 在所有边(上、右、下、左)。我怎样才能做到这一点?请帮帮我。我尝试了与边框单元格相关的所有可能选项,但问题仍未解决。

【问题讨论】:

    标签: ruby-on-rails-4 border html-table cells


    【解决方案1】:

    删除边框最简单的方法是使用嵌套表格。

    <table>
     <table class="TableWithBorder">
      <!--Content-->
     </table>
     <table class="TableWithoutBorder">
      <!--Links-->
     </table>
    </table>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-14
      • 2013-03-26
      • 2015-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多