Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: display output in columns of a table


From   "Tom Boonen" <[email protected]>
To   [email protected]
Subject   st: display output in columns of a table
Date   Tue, 12 Sep 2006 13:47:33 -0400

Hi List,

I have a question on how to use SMCL to display output of my
program in aligned columns of a table. My code reads:

di as txt "{hline}"
di "A: {res}`alist' "
di "B: {res}`blist' "
di "C: {res}`clist' "
di as txt "{hline}"

Here `arlist' , `blist' , and `clist' are numlists entered by the
user. Since `colist' is too long to fit in a single line it overflows
to the next line on the screen. Output looks like this:

------------------------------------------------------------------------------------------------------
A: 3
B: 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
27 28 29 30 31 32 33 34 35 36 37 38 39
C: 4 5 6
------------------------------------------------------------------------------------------------------

Is there any way to display my output in columns of a table instead.
In my case this would be a two column table, where A, B, and C would
go in the first column and the respective numbers in the lists would
go in the second column.

The difference would be that the numbers in `blist' that overflow into
the next line are not displayed below B but remain correctly aligned.

Thanks a lot!

Tom
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index