> Specifically, Tom use the | x | syntax in many clever ways. > For example, Tom lays out flexible tables that work regardless > of what the (macro) | x | expands to.
The problem with Docutils' tables is the difficulty in resizing table columns when you decide to change the text within the tables. For example, if I define the following table and then decide to change "Impl." to "Implementation" then I have to shift the table's graphics and pad each entry in the column. Note: Set Google Groups' font to Fixed-Width to view the example correctly. Select "Options" in the blue bar. +-----+--------+-------+------+ | | Design | Impl. | Test | +-----+--------+-------+------+ | Gui | 4 hrs | 2 Hrs | 1 hr | +-----+--------+-------+------+ | DLL | 3 hrs | 3 Hrs | 1 hr | +-----+--------+-------+------+ To solve this problem, I use the Docutils' ".. replace" directive as follows. Note: The ".. replace" directive uses the same '|' character to delimit its replacement label as the table uses to specify columns. Docutils parses all of the '|'s correctly. .. |Dsgn| Replace:: Design .. |Impl| Replace:: Implementation .. |Test| Replace:: Test .. |Gui| Replace:: Gui .. |DLL| Replace:: DLL +-------+--------+--------+-------+ | | |Dsgn| | |Impl| | |Tst| | +-------+--------+--------+-------+ | |Gui| | 4 hrs | 2 Hrs | 1 hr | +-------+--------+--------+-------+ | |DLL| | 3 hrs | 3 Hrs | 1 hr | +-------+--------+--------+-------+ Using the above approach you can change the column or row header text by changing the text in the ".. |???| Replace::" directive without having to change the table layout. The buttons with their descriptions shown on the following web page are created using a two column table with a separate row for each button. The button graphics are created by defining a one cell table inside each of the first column cells. The borders of the buttons are defined within the web page's style-sheet. http://www.2die4games.com/Carcassonne/Suite/htm/Cfig-Overview.htm Here is the code for the "Help" and "Restore defaults" buttons. .. |Hlp| Replace:: Help .. |HlpDesc| Replace:: Display help on the currently displayed tab card. .. |rdl| Replace:: Restore defaults .. |rdlDesc| Replace:: Set all configuration items on all tab cards to the factory default values. .. |rdlNote| Replace:: The default values are set to the factory settings for version 1.89 of the game regardless of the version actually installed. +-----------+------------------+ | +-------+ | |HlpDesc| | | | |Hlp| | | | | +-------+ | | +-----------+------------------+ | +-------+ | |rdlDesc| | | | |rdl| | | | | +-------+ | :Note: |rdlNote| | +-----------+------------------+ TL -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
