/// <summary></summary>
        public void WriteTable(string[] headers, IEnumerable <string[]> rows, TableFormat tableFormat = null)
        {
            tableFormat = tableFormat == null
                              ? new TableFormat()
                              : tableFormat.Clone();

            var columnsToAutoAdjust = tableFormat.Widths
                                      .Select((width, index) => width >= 0 ? -1 : index)
                                      .Where(i => i >= 0)
                                      .ToArray();

            //if we need to autoalign, make sure we only enumerate the rows once
            // in case it can't be enumerated a second time
            var safeRows = columnsToAutoAdjust.IsNullOrEmpty() ? rows : rows.ToList();

            tableFormat.Widths = FixWidths(safeRows, tableFormat, columnsToAutoAdjust);

            if (!headers.IsNullOrEmpty())
            {
                headers.PivotChunks(tableFormat)
                .ForEach(_writer.WriteLine);
            }

            if (safeRows.IsNullOrEmpty())
            {
                return;
            }

            foreach (var row in safeRows)
            {
                if (row.IsNullOrEmpty())
                {
                    _writer.WriteLine();
                    continue;
                }
                row.PivotChunks(tableFormat)
                .ForEach(_writer.WriteLine);
            }
        }