Help: Creating Tables
UP | Help Index
Creating tables on ned.com is not for the faint of heart.
While the results can be satisfying, the method to achieve them has been known to cause hair loss.
The trick to creating tables on ned.com is to keep in mind how the table would look in plain text. Any given cell within the table can only be one unit wide by one unit tall (you can't have a cell span more than one column or row). All columns must be left-aligned, and each column must be separated by at least one space.
A table consists of three parts:
- The header: Every column in a table MUST have a header explaining what's below.
- The boundary symbols: These are equal signs (=) that delineate how wide the columns are and where the table begins and ends.
- The cell contents: The text that's going to appear within a table.
Here's a simple two column table with the parts labeled:
======== ======== <-- the top table boundary Header 1 Header 2 <-- the header line ======== ======== <-- the bottom of the header boundary cell 1A cell 2A <-- the cell contents cell 1B cell 2B <-- these can be as long as you want cell 1C cell 2C <-- they'll keep going until the table boundary line ======== ======== <-- the bottom table boundary
And here's what it looks like fully rendered:
|Header 1||Header 2|
|cell 1A||cell 2A|
|cell 1B||cell 2B|
|cell 1C||cell 2C|
This next example shows three things:
- The boundary for the last column only needs to be five "=" long.
- Every column EXCEPT the last column must be as wide as the widest cell contents. (see row FIRST below)
- You can see that the last column in a table can be as wide as the page, and the contents of the right-most column can even wrap to the next line in the same cell. (see row THIRD below)
So, if you make your table look like this:
====== ============ ====== short wide column really wide column ====== ============ ====== FIRST This is wide But this is the widest column of all Second So is this And now you see that this column can go a little longer. THIRD and this is You can see that the last column can stretch, just so long as you don't hit the return key. ====== ============ ======
It will render like this:
|short||wide column||really wide column|
|FIRST||This is wide||But this is the widest column of all|
|Second||So is this||And now you see that this column can go a little longer.|
|THIRD||and this is||You can see that the last column can stretch, just so long as you don't hit the return key.|
CVS Table example: ------------:
.. csv-table:: Variable Title :widths: 8,8,20 :header: "Name of Functionality Desired","Workaround","Test" :delim: ; stuff;morestuff;moststuff ;; ;; ;;
Renders to this:
|Name of Functionality Desired||Workaround||Test|