{
 "metadata":{},
 "nbformat":4,
 "nbformat_minor":4,
 "cells":[
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "<!-- jupyter-book 02_05_testdoc.ipynb -->\n",
    "# Tables\n",
    "\n",
    "<div id=\"subsec:table\"></div>\n",
    "\n",
    "<!-- index with comma could fool sphinx -->\n",
    "\n",
    "Let us take this table from the manual:\n",
    "\n",
    "<table class=\"table\" border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"center\">time</th> <th align=\"center\">velocity</th> <th align=\"center\">acceleration</th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"left\">   0.0     </td> <td align=\"right\">   1.4186      </td> <td align=\"right\">   -5.01           </td> </tr>\n",
    "<tr><td align=\"left\">   2.0     </td> <td align=\"right\">   1.376512    </td> <td align=\"right\">   11.919          </td> </tr>\n",
    "<tr><td align=\"left\">   4.0     </td> <td align=\"right\">   1.1E+1      </td> <td align=\"right\">   14.717624       </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "\n",
    "The DocOnce source code reads"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        \n",
    "          |--------------------------------|\n",
    "          |time  | velocity | acceleration |\n",
    "          |--l--------r-----------r--------|\n",
    "          | 0.0  | 1.4186   | -5.01        |\n",
    "          | 2.0  | 1.376512 | 11.919       |\n",
    "          | 4.0  | 1.1E+1   | 14.717624    |\n",
    "          |--------------------------------|\n",
    "        \n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Here is yet another table to test that we can handle more than\n",
    "one table:\n",
    "\n",
    "<table class=\"table\" border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"left\">time</th> <th align=\"left\">velocity</th> <th align=\"left\">acceleration</th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"left\">   0.0     </td> <td align=\"left\">   1.4186      </td> <td align=\"left\">   -5.01           </td> </tr>\n",
    "<tr><td align=\"left\">   1.0     </td> <td align=\"left\">   1.376512    </td> <td align=\"left\">   11.919          </td> </tr>\n",
    "<tr><td align=\"left\">   3.0     </td> <td align=\"left\">   1.1E+1      </td> <td align=\"left\">   14.717624       </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "\n",
    "And one with math headings (that are expanded and must be treated\n",
    "accordingly), verbatim heading and entry, and no space around the pipe\n",
    "symbol:\n",
    "\n",
    "<table class=\"table\" border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"center\">$i$</th> <th align=\"center\">$h_i$ </th> <th align=\"center\">$\\bar T_i$</th> <th align=\"center\"> <code>L_i</code> </th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"left\">   0      </td> <td align=\"right\">   0         </td> <td align=\"right\">   288           </td> <td align=\"right\">   -0.0065    </td> </tr>\n",
    "<tr><td align=\"left\">   1      </td> <td align=\"right\">   11,000    </td> <td align=\"right\">   216           </td> <td align=\"right\">   0.0        </td> </tr>\n",
    "<tr><td align=\"left\">   2      </td> <td align=\"right\">   20,000    </td> <td align=\"right\">   216           </td> <td align=\"right\">   0.001      </td> </tr>\n",
    "<tr><td align=\"left\">   3      </td> <td align=\"right\">   32,000    </td> <td align=\"right\">   228           </td> <td align=\"right\">   0.0028     </td> </tr>\n",
    "<tr><td align=\"left\">   4      </td> <td align=\"right\">   47,000    </td> <td align=\"right\">   270           </td> <td align=\"right\">   0.0        </td> </tr>\n",
    "<tr><td align=\"left\">   5      </td> <td align=\"right\">   51,000    </td> <td align=\"right\">   270           </td> <td align=\"right\">   -0.0028    </td> </tr>\n",
    "<tr><td align=\"left\">   6      </td> <td align=\"right\">   71,000    </td> <td align=\"right\">   214           </td> <td align=\"right\">   <code>NaN</code>      </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "\n",
    "And add one with verbatim headings (with underscores),\n",
    "and rows starting with `|-` because of a negative number,\n",
    "and `|` right before and after verbatim word (with no space):\n",
    "\n",
    "<table class=\"table\" border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"center\">exact</th> <th align=\"center\"><code>v_1</code> </th> <th align=\"center\">$a_i$ + <code>v_2</code></th> <th align=\"center\"><code>verb_3_</code></th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"right\">   9        </td> <td align=\"right\">   9.62      </td> <td align=\"right\">   5.57             </td> <td align=\"right\">   8.98         </td> </tr>\n",
    "<tr><td align=\"right\">   -20      </td> <td align=\"right\">   -23.39    </td> <td align=\"right\">   -7.65            </td> <td align=\"right\">   -19.93       </td> </tr>\n",
    "<tr><td align=\"right\">   10       </td> <td align=\"right\">   17.74     </td> <td align=\"right\">   -4.50            </td> <td align=\"right\">   9.96         </td> </tr>\n",
    "<tr><td align=\"right\">   0        </td> <td align=\"right\">   -9.19     </td> <td align=\"right\">   4.13             </td> <td align=\"right\">   -0.26        </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "\n",
    "Pipe symbols in verbatim and math text in tables used to pose difficulties,\n",
    "but not\n",
    "anymore:\n",
    "\n",
    "<table class=\"table\" border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"center\">    $S$    </th> <th align=\"center\">   command   </th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"left\">   $ ||a_0|| $    </td> <td align=\"right\">   <code>norm|length</code>    </td> </tr>\n",
    "<tr><td align=\"left\">   $x\\cap y$      </td> <td align=\"right\">   <code>x|y</code>            </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "\n",
    "Here is a table with X alignment:\n",
    "\n",
    "<table class=\"table\" border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"center\"> Type</th> <th align=\"center\">                                                                                                     Description                                                                                                      </th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"center\">   X        </td> <td align=\"left\">   Alignment character that is used for specifying a potentially very long text in a column in a table. It makes use of the <code>tabularx</code> package in LaTeX, otherwise (for other formats) it means <code>l</code> (centered alignment).    </td> </tr>\n",
    "<tr><td align=\"center\">   l,r,c    </td> <td align=\"left\">   standard alignment characters                                                                                                                                                                                             </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "\n",
    "Finally, a table with math\n",
    "(`bm` that expands to `boldsymbol`, was tricky, but\n",
    "cleanly handled now)\n",
    "and URLs.\n",
    "\n",
    "<!-- Mako code to expand URLs in the table -->\n",
    "<!-- (These types of tables did not work before Jan 2014) -->\n",
    "\n",
    "<table class=\"table\" border=\"1\">\n",
    "<tr></tr>\n",
    "<tbody>\n",
    "<tr><td align=\"center\">   $\\mathcal{L}=0$                    </td> <td align=\"center\">   [<code>080</code>](../doc/src/manual/mov/wave_frames/frame_0080.png)    </td> <td align=\"center\">   [<code>085</code>](../doc/src/manual/mov/wave_frames/frame_0085.png)    </td> </tr>\n",
    "<tr><td align=\"center\">   $a=b$                              </td> <td align=\"center\">   [<code>090</code>](../doc/src/manual/mov/wave_frames/frame_0090.png)    </td> <td align=\"center\">   [<code>095</code>](../doc/src/manual/mov/wave_frames/frame_0095.png)    </td> </tr>\n",
    "<tr><td align=\"center\">   $\\nabla\\cdot\\boldsymbol{u} =0 $    </td> <td align=\"center\">   [<code>100</code>](../doc/src/manual/mov/wave_frames/frame_0100.png)    </td> <td align=\"center\">   [<code>105</code>](../doc/src/manual/mov/wave_frames/frame_0105.png)    </td> </tr>\n",
    "</tbody>\n",
    "</table>"
   ]
  }
 ]
}