【问题标题】:hiding border of the table隐藏表格边框
【发布时间】:2017-08-05 14:05:49
【问题描述】:

我的 UI 部分总是显示边框。我该如何隐藏它?

<div style="float:left; width:100%; height:40px; padding:25px 10px; text-align: left;">
  <div style="padding-left: 260px;">
    <table width="80%" border="0">
      <tr>
        <td width="35%">
          <b>Equipment Type</b>
          <span style="color:red"> *</span> &nbsp;&nbsp; @Html.DropDownListFor(model => model.ClassId, Model.ObjectClasses, "--Select--", new { id = "ddlObjectClass", @onchange = "ClassonChangefunc()", @style = "width:180px" })
        </td>
        <td width="5%"></td>
        <td width="30%">
          <b>Country</b>
          <span style="color:red"> *</span>&nbsp;&nbsp; @Html.DropDownListFor(model => model.CountryId, Model.CountryList, new { data_val = "false", id = "ddlCountry", name = "ddlCountry", @onchange = "CountryChangefunc()", style = "width:200px;" })
        </td>
      </tr>
    </table>
  </div>
  <div>
  </div>
</div>

但仍然显示边界...

隐藏该边框的简单方法是什么?

【问题讨论】:

  • 你能分享工作代码吗?因为这段代码中没有显示边框
  • 您是否尝试过在您的表格中添加边框:无? ,也尝试提供一个工作示例。
  • 可能此表格应用了某些样式,请尝试在 CSS 中删除它们。因为默认情况下表格没有边框。
  • 如果您的表格没有相关的 CSS,您将只能得到广泛的答案。

标签: html css html-table


【解决方案1】:

为这个特定的表格、它的行和单元格添加这个样式,即为这个表格设置 id(例如id="table),然后为这个表格设置样式。

#table,
#table > tbody > tr,
#table > tbody > tr > td {
  border: 0;
}

【讨论】:

    【解决方案2】:

    您可以更改表格的边框样式

    table, th, td, tr {
        border-style: none; //!important -> if needed
    }
    

    看看表格(html)和边框(css)

    https://www.w3schools.com/html/html_tables.asp

    https://www.w3schools.com/css/css_border.asp

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-24
      • 2012-05-06
      • 2013-08-01
      • 2015-02-21
      • 2015-05-28
      • 2017-04-11
      • 2012-06-18
      • 2012-07-16
      相关资源
      最近更新 更多