Create an HTML table.

 The table body should have at least three rows of three columns.
 Each of these three columns should be labelled "X", "Y", and "Z". 
 An extra column should be added at either the extreme left or the extreme right of the table that has no heading, but is filled with sequential row numbers. 
 The rows of the "X", "Y", and "Z" columns should be filled with random or sequential integers having 4 digits or less. 
 The numbers should be aligned in the same fashion for all columns.


defmodule Table do
  defp put_rows(n) do
    Enum.map_join(1..n, fn i ->
      "<tr align=right><th>#{i}</th>" <>
      Enum.map_join(1..3, fn _ ->
        "<td>#{:rand.uniform(2000)}</td>"
      end) <> "</tr>\n"
    end)
  end
 
  def create_table(n\\3) do
    "<table border=1>\n" <>
    "<th></th><th>X</th><th>Y</th><th>Z</th>\n" <>
    put_rows(n) <>
    "</table>"
  end
end
 
IO.puts Table.create_table