SQLite Forum

Support for Markdown formatted table output from a query
Login
Markdown also allows you to insert raw HTML.  So you could set the SQLite
shell into ".mode html" and then copy/paste the raw table code into your
Markdown document.  Like this:

<table>
<TR><TH>id</TH>
<TH>type</TH>
<TH>value</TH>
</TR>
<TR><TD>1</TD>
<TD>A</TD>
<TD>A-val</TD>
</TR>
<TR><TD>2</TD>
<TD>B</TD>
<TD>B-val</TD>
</TR>
<TR><TD>3</TD>
<TD>C</TD>
<TD>C-val</TD>
</TR>
</table>

Click the "source" button on the header of this post to see the raw text,
which is somewhat unreadable.  But it does render nicely.  And you 
have the option to add things like "border='1'"
in the `<table>` to make it look a little nicer:

<table border='1' cellspacing='0' cellpadding='5'>
<TR><TH>id</TH>
<TH>type</TH>
<TH>value</TH>
</TR>
<TR><TD>1</TD>
<TD>A</TD>
<TD>A-val</TD>
</TR>
<TR><TD>2</TD>
<TD>B</TD>
<TD>B-val</TD>
</TR>
<TR><TD>3</TD>
<TD>C</TD>
<TD>C-val</TD>
</TR>
</table>

Steps to reproduce the above:

~~~~~~
   CREATE TEMP TABLE t1(id,type,value);
   INSERT INTO t1 VALUES(1,'A','A-val'),(2,'B','B-val'),(3,'C','C-val');
   .mode html
   SELECT * FROM t1;
~~~~~~