【问题标题】:How can I make outside border of table different in html?如何在html中使表格的外部边框不同?
【发布时间】:2020-04-06 06:06:00
【问题描述】:

我正在努力实现这个精确的表格:Table wanted

我在这里用 css 样式表编写了这段代码:

table{
    width:90%;
    height:100%;
    margin-left:auto;
    margin-right:auto;
    background-color: white;
    color:#654321;
    border-collapse: collapse   ;
    border-style:outset;
    border-width:px;
    position: relative;
    font-size:20px;
    font-family:DTCRoughM11,arial;

}
tr,th,td{
    padding:5px;
    border-width: 5px;
    border-style:inset;
    border-collapse:separate;   
}

我得到这样的结果: Table i got

基本上,我想做的是将外边框设置为比内边框宽,并带有嵌入边框样式。

我怎样才能做到这一点?

【问题讨论】:

  • 您需要设置border-width: 10px(类似),您可以设置每个边框的颜色不同。我已经看到左边框,上边框的颜色与右边框,下边框的颜色不同。您可以使用这些 css 属性来设置它们。边框底部颜色,边框左颜色,边框顶部颜色,边框右颜色

标签: javascript html css html-table


【解决方案1】:

我认为你有一个错字。这行没有意义:

 border-width:px;

根据屏幕截图,我认为您可能希望这样:

 border-width:3px;

【讨论】:

    【解决方案2】:

    您是否尝试在表格的边框宽度属性上设置宽度?在您提供的代码中,没有定义宽度...

    边框宽度:10px;例如。

    【讨论】:

      猜你喜欢
      • 2012-04-09
      • 1970-01-01
      • 2016-06-04
      • 1970-01-01
      • 1970-01-01
      • 2011-08-18
      • 1970-01-01
      • 2013-06-18
      • 2014-12-15
      相关资源
      最近更新 更多