I have the same question as this question except that I don't see how to do so other than in elisp. I am using Ruby, but I suppose the question applies to other languages as well. If I return an array of arrays as the value result of some code, I want to have it formatted as a table headed with the column names.
Here is the solution to what I want in elisp:
#+BEGIN_SRC emacs-lisp :results value table
'(("First" "Second")
hline
(a b) (c d))
#+END_SRC
#+RESULTS:
| First | Second |
|-------+--------|
| a | b |
| c | d |
But I've tried variants of this in Ruby with no luck. For example:
#+BEGIN_SRC ruby :results value table
[ [ 'First', 'Second'],
:hline,
[ :a, :b ],
[ :c, :d ]
]
#+END_SRC
#+RESULTS:
| (First Second) | :hline | (:a :b) | (:c :d) |
Which is not what I want. So, what is the incantation to use here?