# frozen_string_literal: true require 'tty-table' module Dri module Utils module Table def print_table(headers, rows, alignments: []) if alignments.empty? (1..headers.size).each do alignments.push(:center) end end table = TTY::Table.new(headers, rows) puts table.render(:ascii, resize: true, multiline: true, alignments: alignments) end end end end