Is it possible to change the layour of a table using markdown under docfx
?
For example, the following table is not very good readable, because of the spacing between the columns. Event there is no alternating row color:
| 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 | - |
That is how it is looking in doxfx
:
Some kind of expected behaviour:
We will extend the default template:
Create a file: (Project Folder)\template\styles\main.js
The default DocFX template uses Bootstrap and JQuery, so in main.js put the following:
$(document).ready(function ()
{
$("table").addClass("table table-bordered table-striped table-condensed");
})
This makes the markdown tables identical to those in Api documentation. To play with Bootstrap table styles, see http://www.w3schools.com/bootstrap/bootstrap_tables.asp
Now, we add this template to docfx.json:
In docfx.json, Replace "template": ["default"]
with "template": ["default", "template"]
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With