emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] How to get header in second table generated by src block


From: Vladimir Lomov
Subject: [O] How to get header in second table generated by src block
Date: Sat, 10 Mar 2012 16:00:57 +0900
User-agent: Mutt/1.5.21 (2010-09-15)

--------------------------- 8< ---------------------------
#+TITLE: One code two tables

Hello, I'm adopting my workflow to org, and now I want to understand what I do 
wrong in following.

Suppose I have two tables with headers and three columns. In export to html I 
want to get two tables
with first and third columns only. The first table is
#+name: raw-to-table
#+begin_src emacs-lisp :var table=raw :exports results
  (mapcar
   (lambda (row)
     (if (equal row 'hline) ;; <- special handling for 'hline
         row
       (list (concat "~" (nth 0 row) "~") (nth 2 row))))
   table)
#+end_src

The second table is
#+call: raw-to-table[:exports results](table=raw2)

In my environment the second table doesn't have headers. Why? What I do wrong?

* COMMENT The tables data
#+tblname: raw
| Key  | Code  | Description |
|------+-------+-------------|
| KEY1 | CODE1 | DESCR1      |
| KEY2 | CODE2 | DESCR2      |
| KEY3 | CODE3 | DESCR3      |

Second table, key, code and description differ.

#+tblname: raw2
| Key    | Code    | Description |
|--------+---------+-------------|
| KEY_A1 | CODE_A1 | DESCR_A1    |
| KEY_A2 | CODE_A2 | DESCR_A2    |
| KEY_A3 | CODE_A3 | DESCR_A3    |


P.S. This is not mine code I borrowed it from Eric Schulte. Thanks Eric for the 
code!

P.S.S. The ~:exports results~ in ~#+call~ is taken from previous version
of code when I tried src block with ~:exports none~ (at first I wanted
to separate code and where to insert table).
--------------------------- 8< ---------------------------

-- 
It has been said that man is a rational animal.  All my life I have
been searching for evidence which could support this.
                -- Bertrand Russell



reply via email to

[Prev in Thread] Current Thread [Next in Thread]