From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hajage Subject: Re: row and col spaning in table? Date: Wed, 18 Aug 2010 09:58:59 +0200 Message-ID: References: <83bp9sqdec.fsf@yahoo.it> <4C6B8C90.5010109@christianmoe.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2108560831==" Return-path: Received: from [140.186.70.92] (port=43974 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OldYQ-0003An-U0 for emacs-orgmode@gnu.org; Wed, 18 Aug 2010 03:59:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OldYP-0001CF-FX for emacs-orgmode@gnu.org; Wed, 18 Aug 2010 03:59:22 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]:61022) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OldYP-0001C7-2E for emacs-orgmode@gnu.org; Wed, 18 Aug 2010 03:59:21 -0400 Received: by fxm3 with SMTP id 3so104378fxm.0 for ; Wed, 18 Aug 2010 00:59:20 -0700 (PDT) In-Reply-To: <4C6B8C90.5010109@christianmoe.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: mail@christianmoe.com Cc: emacs-orgmode@gnu.org, Carsten Dominik --===============2108560831== Content-Type: multipart/alternative; boundary=001485f3e60e5c3c6b048e1471c7 --001485f3e60e5c3c6b048e1471c7 Content-Type: text/plain; charset=ISO-8859-1 Well, it seems a good solution to me! David On Wed, Aug 18, 2010 at 09:32, Christian Moe wrote: > Giovanni Ridolfi wrote: > >> David Hajage writes: >> >> and I was wondering if row and col spaning was possible? >>> >> Currently not. But, if this is your case, you should use the table.el >> package. >> > > Yes. Still, I'd tentatively suggest adding a feature to span Org-table > cells across rows and columns -- on *export* only. (Sorry if this has been > thought of before.) > > Why? For static tables with complex layout, the table.el integration > is just what the doctor ordered and works really smoothly, and clearly > one would not want to mess up the ease and speed of Org-tables by > adding complexity like row and column spanning in the table editor. > > But what if, say, one is using the spreadsheet functionality, > frequently updates the content for publication, and would like to > e.g. span headers over multiple sub-headers? It seems less than > optimal to maintain and update a separate Org table, then convert it > to table.el and manually edit it every time one wants to publish, > spanning the same cells each time. > > For this purpose, it would be nice to be able to define reusable cell > spans the same way table formulas are entered, and with the same > syntax. Here's an idea for how it might look: > > #+CAPTION: Foo and bar sales by region > | Region | Sales | | | | | | | | > | | Q1 | | Q2 | | Q3 | | Q4 | | > | | foo | bar | foo | bar | foo | bar | foo | bar | > |--------+-------+-----+-----+-----+-----+-----+-----+-----| > | North | 350 | 46 | 253 | 34 | 234 | 42 | 382 | 68 | > | South | 462 | 84 | 511 | 78 | 435 | 45 | 534 | 89 | > #+TBLSPAN: A1..A3::A2..I1::B2..C2::D2..E2::F2..G2::H2..I2 > > The exporter would read the TBLSPAN line to see what cells should be > merged. It would concatenate the cell contents (if any), and add the > appropriate HTML, LaTeX or DocBook formatting. [1] > > +--------+-------------------------------------------------+ > | Region | Sales | > | +-------------+-----------+-----------+-----------+ > | | Q1 | Q2 | Q3 | Q4 | > | +-------+-----+-----+-----+-----+-----+-----+-----+ > | | foo | bar | foo | bar | foo | bar | foo | bar | > +--------+-------+-----+-----+-----+-----+-----+-----+-----+ > | North | 350 | 46 | 253 | 34 | 234 | 42 | 382 | 68 | > +--------+-------+-----+-----+-----+-----+-----+-----+-----+ > | South | 462 | 84 | 511 | 78 | 435 | 45 | 534 | 89 | > +--------+-------+-----+-----+-----+-----+-----+-----+-----+ > > Another example: > > | | Col A | Col B | | > |-------+-------+-------+-----| > | Row 1 | A1 | B1 | C1 | > | | A1b | B1b | C1b | > | Row 2 | A2 | B2 | C2 | > | | A2b | B2b | C2b | > #+TBLSPAN: @1$3..@1$4::@2$2..@3$2::@4$3..@5$4 > > would result in output like: > > +---+-----+-----------+ > | | A | B | > +---+-----+-----+-----+ > | 1 | A1 | B1 | C1 | > | | +-----+-----+ > | | A1b | B1b | C1b | > +---+-----+-----+-----+ > | 2 | A2 | B2 C2 | > | +-----+ | > | | A2b | B2b C2b | > +---+-----+-----------+ > > [1] HTML: =rowspan= and =colspan= attributes of the =th= and =td= > elements. LaTeX: =\multicolumn= and =\multirow= commands. DocBook: > =namest=, =nameend= and =morerows= attributes of the =entry= > element. > > --001485f3e60e5c3c6b048e1471c7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Well, it seems a good solution to me!
David


On Wed, Aug 18, 2010 at 09:32, Christian= Moe <mail@ch= ristianmoe.com> wrote:
Giovanni Ridolfi wrote:
David Hajage <dha= jage@gmail.com> writes:

and I was wondering if row and col spaning was possible?
Currently not. But, if this is your case, you should use the table.el packa= ge.

Yes. Still, I'd tentatively suggest adding a feature to span Org-table = cells across rows and columns -- on *export* only. (Sorry if this has been = thought of before.)

Why? For static tables with complex layout, the table.el integration
is just what the doctor ordered and works really smoothly, and clearly
one would not want to mess up the ease and speed of Org-tables by
adding complexity like row and column spanning in the table editor.

But what if, say, one is using the spreadsheet functionality,
frequently updates the content for publication, and would like to
e.g. span headers over multiple sub-headers? It seems less than
optimal to maintain and update a separate Org table, then convert it
to table.el and manually edit it every time one wants to publish,
spanning the same cells each time.

For this purpose, it would be nice to be able to define reusable cell
spans the same way table formulas are entered, and with the same
syntax. Here's an idea for how it might look:

#+CAPTION: Foo and bar sales by region
| Region | Sales | =A0 =A0 | =A0 =A0 | =A0 =A0 | =A0 =A0 | =A0 =A0 | =A0 = =A0 | =A0 =A0 |
| =A0 =A0 =A0 =A0| Q1 =A0 =A0| =A0 =A0 | =A0Q2 | =A0 =A0 | =A0Q3 | =A0 =A0 = | =A0Q4 | =A0 =A0 |
| =A0 =A0 =A0 =A0| foo =A0 | bar | foo | bar | foo | bar | foo | bar |
|--------+-------+-----+-----+-----+-----+-----+-----+-----|
| North =A0| 350 =A0 | =A046 | 253 | =A034 | 234 | =A042 | 382 | =A068 | | South =A0| 462 =A0 | =A084 | 511 | =A078 | 435 | =A045 | 534 | =A089 | #+TBLSPAN: A1..A3::A2..I1::B2..C2::D2..E2::F2..G2::H2..I2

The exporter would read the TBLSPAN line to see what cells should be
merged. It would concatenate the cell contents (if any), and add the
appropriate HTML, LaTeX or DocBook formatting. [1]

+--------+-------------------------------------------------+
| Region | =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Sales =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0|
| =A0 =A0 =A0 =A0+-------------+-----------+-----------+-----------+
| =A0 =A0 =A0 =A0| =A0 =A0 =A0Q1 =A0 =A0 | =A0 =A0Q2 =A0 =A0 | =A0 =A0Q3 = =A0 =A0 | =A0 =A0Q4 =A0 =A0 |
| =A0 =A0 =A0 =A0+-------+-----+-----+-----+-----+-----+-----+-----+
| =A0 =A0 =A0 =A0| foo =A0 | bar | foo | bar | foo | bar | foo | bar |
+--------+-------+-----+-----+-----+-----+-----+-----+-----+
| North =A0| 350 =A0 | =A046 | 253 | =A034 | 234 | =A042 | 382 | =A068 | +--------+-------+-----+-----+-----+-----+-----+-----+-----+
| South =A0| 462 =A0 | =A084 | 511 | =A078 | 435 | =A045 | 534 | =A089 | +--------+-------+-----+-----+-----+-----+-----+-----+-----+

Another example:

| =A0 =A0 =A0 | Col A | Col B | =A0 =A0 |
|-------+-------+-------+-----|
| Row 1 | A1 =A0 =A0| B1 =A0 =A0| C1 =A0|
| =A0 =A0 =A0 | A1b =A0 | B1b =A0 | C1b |
| Row 2 | A2 =A0 =A0| B2 =A0 =A0| C2 =A0|
| =A0 =A0 =A0 | A2b =A0 | B2b =A0 | C2b |
#+TBLSPAN: @1$3..@1$4::@2$2..@3$2::@4$3..@5$4

would result in output like:

+---+-----+-----------+
| =A0 | A =A0 | B =A0 =A0 =A0 =A0 |
+---+-----+-----+-----+
| 1 | A1 =A0| B1 =A0| C1 =A0|
| =A0 | =A0 =A0 +-----+-----+
| =A0 | A1b | B1b | C1b |
+---+-----+-----+-----+
| 2 | A2 =A0| =A0 B2 C2 =A0 |
| =A0 +-----+ =A0 =A0 =A0 =A0 =A0 |
| =A0 | A2b | =A0B2b C2b =A0|
+---+-----+-----------+

[1] HTML: =3Drowspan=3D and =3Dcolspan=3D attributes of the =3Dth=3D and = =3Dtd=3D
=A0 =A0elements. LaTeX: =3D\multicolumn=3D and =3D\multirow=3D commands. D= ocBook:
=A0 =A0=3Dnamest=3D, =3Dnameend=3D and =3Dmorerows=3D attributes of the = =3Dentry=3D
=A0 =A0element.


--001485f3e60e5c3c6b048e1471c7-- --===============2108560831== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============2108560831==--