   defp render_table([], _, _),
     do: nil
 
-  defp table_header?(row), do:
-    Enum.all?(row, fn {col, _} -> col =~ ~r/^:?-+:?$/ end)
+  defp table_header?(row) do
+    Enum.all?(row, fn {col, _} -> table_header_column?(col) end)
+  end
+
+  defp table_header_column?(":" <> row), do: table_header_contents?(row)
+  defp table_header_column?(row), do: table_header_contents?(row)
+
+  defp table_header_contents?("-" <> row), do: table_header_contents?(row)
+  defp table_header_contents?(":"), do: true
+  defp table_header_contents?(""), do: true
+  defp table_header_contents?(_), do: false
 
   defp draw_table_row(cols_and_widths, options, heading \\ false) do
     columns =

    line
    |> String.trim("|")
    |> String.trim()
    |> String.split(~r/\s\|\s/)
    |> Enum.map(&render_column(&1, options))
  end

  defp render_column(col, options) do
    col = col
          |> String.replace(~r/\\ \|/x, "|")
          |> handle_links
          |> handle_inline(options)
    {col, length_without_escape(col, 0)}
  end


    count = Enum.map(lines, &length/1) |> Enum.max
    lines = Enum.map(lines, &pad_to_number_of_columns(&1, count))

    widths =
      for line <- lines do
        for {_col, length} <- line, do: length
      end

    col_widths = Enum.reduce(widths,
                             List.duplicate(0, count),
