From: Vladimir Lomov <lomov.vl@gmail.com>
To: emacs-orgmode@gnu.org
Subject: How to get header in second table generated by src block
Date: Sat, 10 Mar 2012 16:00:57 +0900 [thread overview]
Message-ID: <20120310070057.GA863@smoon> (raw)
--------------------------- 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
next reply other threads:[~2012-03-10 7:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-10 7:00 Vladimir Lomov [this message]
2012-03-10 16:58 ` How to get header in second table generated by src block Marc-Oliver Ihm
2012-03-11 2:11 ` Vladimir Lomov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120310070057.GA863@smoon \
--to=lomov.vl@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).