ActiveState Code

Recipe 364231: puts_tabular


Proc to write data in tabular format.

Tcl
1
2
3
4
5
# Print columns
proc puts_tabular {width args} {
    set fmt [string repeat "%-${width}s" [llength $args]]
    puts [eval [list format $fmt] $args]
}

Sign in to comment