I will conclude our discussion of tables with an example, one that was promised in the Preface to the book. Let me first recap the situation.
In writing this book, I was faced with the problem of turning long columns of words into tables. The built-in ConvertToTable command was not flexible enough for my needs for three reasons.
First, I wanted the items to be placed in the table in column-major order (the first column is filled first), rather than in row-major order (the first row is filled first). Second, I wanted to choose the number of columns based on the number of words (cells), so I needed a report on the word count before I made the choice of the number of columns. Finally, I wanted a row at the top of the table for a title.
To illustrate, I wanted to be able to select the following column of words:
Figure 16-5. Table-making dialog box
Figure 16-6. Three-column table produced from a column of text
The code is shown in Example 16-1. (I think that you should get a ...