4 padWith :: a -> Int -> [a] -> [a]
6 padWith e n [] = replicate n e
7 padWith e (n+1) (h:t) = h:(padWith e n t)
9 formatTable :: [[String]] -> String
11 let columnWidths = map (\col -> maximum $ map length col)
15 let rowCells = zipWith (padWith ' ') columnWidths row in
16 intercalate " " rowCells