简体   繁体   English

如何使FsLab表渲染得很好?

[英]How to make FsLab tables render nicely?

Is there some template or trick to help data tables render nicely in FsLab? 是否有一些模板或技巧可以帮助数据表在FsLab中很好地呈现? The tables I produce are not as pretty as the tables I see in samples/tutorials. 我生成的表格不如我在样本/教程中看到的表格那么漂亮。

As an example, when I do this example I end up with a table that looks like this: 作为一个例子,当我做这个例子时,我最终得到一个如下所示的表:

在此输入图像描述

whereas the sample on Tomas' walkthrough looks much prettier with the fonts & look/feel matching the surrounding page: 而Tomas的演练样本看起来漂亮,字体和外观与周围页面匹配:

在此输入图像描述

Is there some theme, setting or control in FsLab that I am missing or is Tomas just doing some css wizardry on his site? FsLab中是否存在我缺少的主题,设置或控制,或者是Tomas在他的网站上做了一些css魔法?

It seems like most of the other examples I see on the web look much closer to the pretty version than the version I see 看起来我在网上看到的大多数其他示例看起来都比我看到的版本更接近漂亮的版本

The recent version of FsLab changed how the formatting works - rather than having built-in formatters for Deedle, it now uses fsi.AddHtmlPrinter , which also works in Atom. 最新版本的FsLab改变了格式化的工作方式 - 而不是为Deedle提供内置格式化程序,它现在使用fsi.AddHtmlPrinter ,它也适用于Atom。

The styling for tables is currently hard-coded in the formatter for Deedle. 表格的样式目前 Deedle 的格式化程序中进行了硬编码

I think it should be possible to override those with the appropriate CSS - after all, the generated document is just HTML. 我认为应该可以用适当的CSS覆盖那些 - 毕竟,生成的文档只是HTML。

One other trick in the new version of FsLab is that it generates different HTML when you run it "live" (then it can load all data from a table on demand) and when you run it in offline mode (then you get standalone HTML). 新版本的FsLab中的另一个技巧是,当你“实时”运行它时会生成不同的HTML(然后它可以根据需要从表中加载所有数据)以及在脱机模式下运行它时(然后你得到独立的HTML) 。

You can explicitly change this by adding the following to the script: 您可以通过向脚本添加以下内容来显式更改此设置:

#if HAS_FSI_ADDHTMLPRINTER
fsi.HtmlPrinterParameters.["html-standalone-output"] <- true
#endif

The journal template is still a beta version, so the documentation is sadly a bit lacking. 期刊模板仍然是测试版,所以文档遗憾地有点缺乏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM