Jump to content

Align columns: Difference between revisions

→‎{{header|q}}: remove tabulation
(→‎{{header|q}}: remove tabulation)
Line 6,307:
ta:{[aln;txt] / tabulate aligned
sl:(count'')s:"$"vs/:txt; / strings and their lengths
tbl8cw:{0^yrl#\:max x@/:\:x}[til max rl:count each x}sl]; / cell / tabulatewidths
alignps:`L$[aln=`R`C!( ;-1-cw;1+cw]$''s; / alignmentpadded functionsstrings
{ps:$[aln=`C;(1+maxneg(cw-sl)div x2)$rotate'/:y}'ps;ps]; / leftcenter
{(-1-max x)$'/:y},[;"\n\n"]"\n"sv raze each ps; } / print</ rightlang>
{mx:max x;(neg(mx-/:x)div 2)rotate''(1+mx)$'/:y} ); / center
1,[;"\n\n"]"\n"sv raze each(align aln). tbl8 each(sl;s); }</lang>
{{out}}
<pre>q)ta[`L]text
39

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.