是否可以使用下的markdown更改表的布局docfx?
例如,由于列之间的间隔,下表的可读性不是很好。事件没有交替的行颜色:
| Property | Description |
|---|---|
| URL | `/api/<version>/auth/login` |
| Method | `post` |
| Success | Http status *200* |
| Failure | Http-status *400/500* |
| Content/Media-Type | `application/json` |
| Authorization | *no* |
| Roles | - |
Run Code Online (Sandbox Code Playgroud)
那就是它的样子doxfx:
某种预期的行为:
我们将扩展默认模板:
创建一个文件: (Project Folder)\template\styles\main.js
默认的DocFX模板使用Bootstrap和JQuery,因此在main.js中放入以下内容:
$(document).ready(function ()
{
$("table").addClass("table table-bordered table-striped table-condensed");
})
Run Code Online (Sandbox Code Playgroud)
这使得降价表与Api文档中的相同。要使用Bootstrap表样式,请访问http://www.w3schools.com/bootstrap/bootstrap_tables.asp
现在,我们将此模板添加到docfx.json中:
在docfx.json中,替换"template": ["default"]为"template": ["default", "template"]。