Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertical table headers (i.e. headers on the left) in Markdown?

Is it possible to create a table with vertical headers (i.e. headers on the left) in any versions of Markdown, without resorting to workarounds like manually **bolding** normal table cells?

Currently the only way I'm aware of is the following:

enter image description here

like image 538
WackGet Avatar asked Apr 02 '20 16:04

WackGet


2 Answers

As Waylan suggested in the comments, we can use pure HTML in Markdown.

<table>
  <tr>
    <th>Fruit</th>
    <td>Banana</td>
  </tr>
  <tr>
    <th>Vegetable</th>
    <td>Carrot</td>
  </tr>
</table>
like image 71
Roshana Pitigala Avatar answered Oct 18 '22 01:10

Roshana Pitigala


In my case I had to embed json data into the table, like so :

<table>
 <tr>
     <th><i>Endpoint</i></th>
     <td>POST https://data-consumer-app.azurewebsites.net/splunk/api/post/dacLogins</td>
 </tr>
 <tr>
     <th><i>Description</th>
     <td>Webhook to post data </td>
 </tr>
 <tr>
    <th><i>Request Payload</th>
    <td>
    
 ```json
 {
   "sid": "scheduler__admin__search__LoginTimelineB4980_1832_897",
   "search_name": "LoginTimelineByDC",
   "app": "search",
   "owner": "admin",
   "results_link": "http://v1host:8000/app/search/@go?sid=scheduler__admin__search__LoByDC_at_1630474980_1832",
   "result": {
     "LoginDate": "2021-08-18",
     "DataCenter": "DC401",
     "Company": "GARBLES00073",
     "LoginCount": "11"
   }
 }
 ``` 
 </td>
 </tr>
 <tr>
    <th>Response Code</th>
    <td>Created :201, ErrorCode(s) : Error: 500, InvalidData : 400 </td>
 </tr>
 </table>
like image 1
Alferd Nobel Avatar answered Oct 18 '22 03:10

Alferd Nobel