<div dir="ltr"><div>`pretty-print' is not really meant to print tables. You probably want to use `~a' instead, which has various arguments related to width:<br><a href="http://docs.racket-lang.org/reference/strings.html?q=~a#%28def._%28%28lib._racket%2Fformat..rkt%29._~7ea%29%29">http://docs.racket-lang.org/reference/strings.html?q=~a#%28def._%28%28lib._racket%2Fformat..rkt%29._~7ea%29%29</a><br>
<br></div><div>For example:<br>(for ([s '("auie" "bépoauie" 5 10)]<br> [w '(10 4 8 2)])<br> (display (~a s #:width w)))<br><br>Laurent<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Nov 25, 2013 at 5:39 PM, Eli Nistal <span dir="ltr"><<a href="mailto:emnistal@gmail.com" target="_blank">emnistal@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div>Hello,<br><br>I am trying to output a table with different column widths. That is, each column in the table will have a different column width. It looks like pretty printing and parameterizing column widths might do the trick but I have not been able to put it together and get it to work.<br>
<br></div>I have a function that determines the maximum string length for each entry in a column, from a transposed/pivoted list of lists/matrix and returns a list of those maximums for each column. Now I would like to apply those widths to each column as each line is printed.<br>
<br></div>This is for a simple text file.<br><br></div>Any examples or pointers to examples or docs would be much appreciated.<br><br></div>Regards<span class="HOEnZb"><font color="#888888"><br clear="all"><div><div><div>
<div><div><br>-- <br>You can meet at his location,<br>
but you better come with cash.<br><br>-- Cake
</div></div></div></div></div></font></span></div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>