ahonn / hexo-theme-even

:rocket: A super concise theme for Hexo
https://ahonn.github.io/hexo-theme-even/
MIT License
1.36k stars 212 forks source link

表格显示无格式问题 #226

Closed unionepro closed 5 years ago

unionepro commented 5 years ago

用了这个主题,但是显示出的表格像没有添加任何格式一样。表格的代码如下:

| Item      | Value    | Qty  |
| :-------: | --------:| :--: |
| Computer  | 1600 USD | 5    |
| Phone     | 12 USD   | 12   |
| Pipe      | 1 USD    | 234  |

但显示出来的却是如下图这样的,好像没有任何格式设置。试了Safari, Chrome, Firefox都是如此。

2018-12-28 2 11 45

看了源代码,发现在样式文件even/source/css/_partial/_post/_content.scss中以下内容复制到.responsive-table定义之外可以解决显示问题。这个不知道是代码的问题,还是我哪里出错了?

  table {
      width: 100%;
      max-width: 100%;
      border-spacing: 0;
      box-shadow: 2px 2px 3px rgba(0,0,0,.125);

      thead {
        background: $deputy-color;
      }

      th, td {
        padding: 5px 15px;
        border: 1px double $content-table-border-color;
      }
  }
ahonn commented 5 years ago

emm,我猜测是本地启动的服务没有加载到 even.js 这个文件,导致 .responsive-table 类没有加上。发布到 github pages 试试?

这里的确是需要把 .table 提到 .responsive-table 来避免这种问题,你现在有空么?欢迎 PR

unionepro commented 5 years ago

发布到github pages还是一样不行。

虽然将.table提出来可以解决问题,但是这样表格就不是responsive了,里面很多其它responsive定义岂不是也没有效果。有没有更好的解决办法?

ahonn commented 5 years ago

提出来跟是不是 responsive 没有关系,提出来之后表格的基础样式就不依赖 .responsive-table 了

ahonn commented 5 years ago

贴一下 hexo s --debug 访问页面之后的日志?

unionepro commented 5 years ago

even.js应该是加载了,因为访问统计之类的功能都是正常的。

ahonn commented 5 years ago

那就奇怪了, 等我晚上下班回家再看看吧

unionepro commented 5 years ago

等你看吧,我现在不太懂这个。以下是访问日志:

2018-12-28 2 42 45
jingsam commented 5 years ago

我也碰到同样的问题 image

http://jingsam.github.io/2016/11/01/peerDependencies-in-Vue-components.html