emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* row and col spaning in table?
@ 2010-07-26 11:55 David Hajage
  2010-07-28  7:22 ` Giovanni Ridolfi
  0 siblings, 1 reply; 11+ messages in thread
From: David Hajage @ 2010-07-26 11:55 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1988 bytes --]

Hello,

I think org-mode is a very great tool. I use a lot of tables in my documents
produced with org, and I was wondering if row and col spaning was possible?
If not, is there any plan to add this feature in a future release? So that
this kind of tables work:

|-------+-----------+-----+-------+-------+-------+-------+-------+------|
|                         | agegp                                        |
|                         +-------+-------+-------+-------+-------+------|
|                         | 25-34 | 35-44 | 45-54 | 55-64 | 65-74 | 75+  |
|=======+===========+=====+=======+=======+=======+=======+=======+======|
| alcgp | 0-39g/day | n   | 4     | 4     | 4     | 4     | 4     | 3    |
|       +           +-----+-------+-------+-------+-------+-------+------|
|       |           | col | 0.27  | 0.27  | 0.25  | 0.25  | 0.27  | 0.27 |
|       +-----------+-----+-------+-------+-------+-------+-------+------|
|       | 40-79     | n   | 4     | 4     | 4     | 4     | 3     | 4    |
|       +           +-----+-------+-------+-------+-------+-------+------|
|       |           | col | 0.27  | 0.27  | 0.25  | 0.25  | 0.20  | 0.36 |
|       +-----------+-----+-------+-------+-------+-------+-------+------|
|       | 80-119    | n   | 3     | 4     | 4     | 4     | 4     | 2    |
|       +           +-----+-------+-------+-------+-------+-------+------|
|       |           | col | 0.20  | 0.27  | 0.25  | 0.25  | 0.27  | 0.18 |
|       +-----------+-----+-------+-------+-------+-------+-------+------|
|       | 120+      | n   | 4     | 3     | 4     | 4     | 4     | 2    |
|       +           +-----+-------+-------+-------+-------+-------+------|
|       |           | col | 0.27  | 0.20  | 0.25  | 0.25  | 0.27  | 0.18 |
|-------+-----------+-----+-------+-------+-------+-------+-------+------|

I know this is not a small request, and I don't know how to adapt
spreadsheet capabilities to that kind of table, but...

Thank you very much.
David

[-- Attachment #1.2: Type: text/html, Size: 2441 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: row and col spaning in table?
  2010-07-26 11:55 row and col spaning in table? David Hajage
@ 2010-07-28  7:22 ` Giovanni Ridolfi
  2010-07-28 18:28   ` Srinivas
  2010-08-18  7:32   ` Christian Moe
  0 siblings, 2 replies; 11+ messages in thread
From: Giovanni Ridolfi @ 2010-07-28  7:22 UTC (permalink / raw)
  To: David Hajage; +Cc: emacs-orgmode

David Hajage <dhajage@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 package.

> If not, is there any plan to add this feature in a future release? 
I don't think so. There's already the table.el package.
 Please see the manual (emphasis is mine) 

(Packages that Org cooperates with):

`table.el' by Takaaki Ota
     Complex ASCII tables with automatic line wrapping, column- and
     row-spanning, and alignment can be created using the Emacs table
     package by Takaaki Ota (`http://sourceforge.net/projects/table',
     and also part of Emacs 22).  

     *Org-mode will recognize these tables and export them properly.*

     Because of interference with other
     Org-mode functionality, you unfortunately cannot edit these tables
     directly in the buffer.  Instead, you need to use the command `C-c
     '' to edit them, similar to source code snippets.

    `C-c ''
          Edit a `table.el' table.  Works when the cursor is in a
          table.el table.

    `C-c ~'
          Insert a `table.el' table.  If there is already a table at
          point, this command converts it between the `table.el' format
          and the Org-mode format.  See the documentation string of the
          command `org-convert-table' for the restrictions under which
          this is possible.  `table.el' is part of Emacs since Emacs 22.

cheers,
Giovanni

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: row and col spaning in table?
  2010-07-28  7:22 ` Giovanni Ridolfi
@ 2010-07-28 18:28   ` Srinivas
  2010-08-16 12:45     ` Carsten Dominik
  2010-08-18  7:32   ` Christian Moe
  1 sibling, 1 reply; 11+ messages in thread
From: Srinivas @ 2010-07-28 18:28 UTC (permalink / raw)
  To: emacs-orgmode

Giovanni Ridolfi <giovanni.ridolfi <at> yahoo.it> writes:

> 
> David Hajage <dhajage <at> 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 package.
> 

For some reason, I haven't been able to get table.el to work properly during 
the org-mode publish operation.

Carsten had mentioned that this functionality had been fixed in the 6.36x 
builds but I still haven't been able to get it to work. I would like to see a 
work example, if you have one.

Here is my sample file:

---- begin snip

* sample table

+ ------+--------+
+-------+--------+
|       | file   |
+-------+--------+
+ ------+--------+
|       |  file  |
+ ------+        |
|  test |  test  |
+ ------+--------+
* Org mode table

| Header 1 | Header 2 |
|----------+----------|
| R1 C1    | R1 C2    |
| R2 C1    | R2 C2    |
| R3 C1    | R3 C2    |

* table.el table

Following table has 1 multi column cell and 1 multi row cell.

+----------+----------+
| Header 1 | Header 2 |
+----------+----------+
| R1 C1-2             |
+---------------------+
| R2 C1    | R2-3 C2  |
+----------+----------+
| R3 C1    |          |
+----------+----------+


--- end snip

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Re: row and col spaning in table?
  2010-07-28 18:28   ` Srinivas
@ 2010-08-16 12:45     ` Carsten Dominik
  2010-08-16 21:24       ` Tak Ota
  0 siblings, 1 reply; 11+ messages in thread
From: Carsten Dominik @ 2010-08-16 12:45 UTC (permalink / raw)
  To: Srinivas; +Cc: emacs-orgmode Mailinglist, Takaaki Ota


On Jul 28, 2010, at 8:28 PM, Srinivas wrote:

> Giovanni Ridolfi <giovanni.ridolfi <at> yahoo.it> writes:
>
>>
>> David Hajage <dhajage <at> 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 package.
>>
>
> For some reason, I haven't been able to get table.el to work  
> properly during
> the org-mode publish operation.
>
> Carsten had mentioned that this functionality had been fixed in the  
> 6.36x
> builds but I still haven't been able to get it to work. I would like  
> to see a
> work example, if you have one.
>
> Here is my sample file:
>
> ---- begin snip
>
> * sample table
>
> + ------+--------+
> +-------+--------+
> |       | file   |
> +-------+--------+
> + ------+--------+
> |       |  file  |
> + ------+        |
> |  test |  test  |
> + ------+--------+

What is this table above supposed to mean?


> * Org mode table
>
> | Header 1 | Header 2 |
> |----------+----------|
> | R1 C1    | R1 C2    |
> | R2 C1    | R2 C2    |
> | R3 C1    | R3 C2    |

This org-mode table works fine.

>
> * table.el table
>
> Following table has 1 multi column cell and 1 multi row cell.
>
> +----------+----------+
> | Header 1 | Header 2 |
> +----------+----------+
> | R1 C1-2             |
> +---------------------+
> | R2 C1    | R2-3 C2  |
> +----------+----------+
> | R3 C1    |          |
> +----------+----------+

This starts an infinite loop when trying to convert it to HTML.
Org is simply calling the HTML converter in table.el, and that
code gets stuck.  So  I think this is a bug in table.el - please
contact the author of that package,

       Takaaki Ota <Takaaki.Ota@am.sony.com>

And report back here!

Thanks!

- Carsten

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Re: row and col spaning in table?
  2010-08-16 12:45     ` Carsten Dominik
@ 2010-08-16 21:24       ` Tak Ota
  2010-08-17  5:01         ` Carsten Dominik
  0 siblings, 1 reply; 11+ messages in thread
From: Tak Ota @ 2010-08-16 21:24 UTC (permalink / raw)
  To: carsten.dominik; +Cc: emacs-orgmode, sp_us

Mon, 16 Aug 2010 05:45:03 -0700: Carsten Dominik <carsten.dominik@gmail.com> wrote:

> 
> On Jul 28, 2010, at 8:28 PM, Srinivas wrote:
> 
> > Giovanni Ridolfi <giovanni.ridolfi <at> yahoo.it> writes:
> >
> >>
> >> David Hajage <dhajage <at> 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 package.
> >>
> >
> > For some reason, I haven't been able to get table.el to work  
> > properly during
> > the org-mode publish operation.
> >
> > Carsten had mentioned that this functionality had been fixed in the  
> > 6.36x
> > builds but I still haven't been able to get it to work. I would like  
> > to see a
> > work example, if you have one.
> >
> > Here is my sample file:
> >
> > ---- begin snip
> >
> > * sample table
> >
> > + ------+--------+
> > +-------+--------+
> > |       | file   |
> > +-------+--------+
> > + ------+--------+
> > |       |  file  |
> > + ------+        |
> > |  test |  test  |
> > + ------+--------+
> 
> What is this table above supposed to mean?
> 
> 
> > * Org mode table
> >
> > | Header 1 | Header 2 |
> > |----------+----------|
> > | R1 C1    | R1 C2    |
> > | R2 C1    | R2 C2    |
> > | R3 C1    | R3 C2    |
> 
> This org-mode table works fine.
> 
> >
> > * table.el table
> >
> > Following table has 1 multi column cell and 1 multi row cell.
> >
> > +----------+----------+
> > | Header 1 | Header 2 |
> > +----------+----------+
> > | R1 C1-2             |
> > +---------------------+
> > | R2 C1    | R2-3 C2  |
> > +----------+----------+
> > | R3 C1    |          |
> > +----------+----------+
> 
> This starts an infinite loop when trying to convert it to HTML.
> Org is simply calling the HTML converter in table.el, and that
> code gets stuck.  So  I think this is a bug in table.el - please
> contact the author of that package,
> 
>        Takaaki Ota <Takaaki.Ota@am.sony.com>

The above table is illegal from the table.el definition point of view.
The three way intersection between the cells "R1 C1-2", "R2 C1" and
"R2-3 C2" must be a '+' instead of a '-'.  I admit the current
implementation is inferior as it gets into infinite loop instead of
reporting this error.

-Tak

> 
> And report back here!
> 
> Thanks!
> 
> - Carsten
> 
> 
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Re: row and col spaning in table?
  2010-08-16 21:24       ` Tak Ota
@ 2010-08-17  5:01         ` Carsten Dominik
  2010-08-17 23:51           ` Srinivas
  0 siblings, 1 reply; 11+ messages in thread
From: Carsten Dominik @ 2010-08-17  5:01 UTC (permalink / raw)
  To: Tak Ota; +Cc: emacs-orgmode, sp_us


On Aug 16, 2010, at 11:24 PM, Tak Ota wrote:

> Mon, 16 Aug 2010 05:45:03 -0700: Carsten Dominik <carsten.dominik@gmail.com 
> > wrote:
>
>>
>> On Jul 28, 2010, at 8:28 PM, Srinivas wrote:
>>
>>> Giovanni Ridolfi <giovanni.ridolfi <at> yahoo.it> writes:
>>>
>>>>
>>>> David Hajage <dhajage <at> 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 package.
>>>>
>>>
>>> For some reason, I haven't been able to get table.el to work
>>> properly during
>>> the org-mode publish operation.
>>>
>>> Carsten had mentioned that this functionality had been fixed in the
>>> 6.36x
>>> builds but I still haven't been able to get it to work. I would like
>>> to see a
>>> work example, if you have one.
>>>
>>> Here is my sample file:
>>>
>>> ---- begin snip
>>>
>>> * sample table
>>>
>>> + ------+--------+
>>> +-------+--------+
>>> |       | file   |
>>> +-------+--------+
>>> + ------+--------+
>>> |       |  file  |
>>> + ------+        |
>>> |  test |  test  |
>>> + ------+--------+
>>
>> What is this table above supposed to mean?
>>
>>
>>> * Org mode table
>>>
>>> | Header 1 | Header 2 |
>>> |----------+----------|
>>> | R1 C1    | R1 C2    |
>>> | R2 C1    | R2 C2    |
>>> | R3 C1    | R3 C2    |
>>
>> This org-mode table works fine.
>>
>>>
>>> * table.el table
>>>
>>> Following table has 1 multi column cell and 1 multi row cell.
>>>
>>> +----------+----------+
>>> | Header 1 | Header 2 |
>>> +----------+----------+
>>> | R1 C1-2             |
>>> +---------------------+
>>> | R2 C1    | R2-3 C2  |
>>> +----------+----------+
>>> | R3 C1    |          |
>>> +----------+----------+
>>
>> This starts an infinite loop when trying to convert it to HTML.
>> Org is simply calling the HTML converter in table.el, and that
>> code gets stuck.  So  I think this is a bug in table.el - please
>> contact the author of that package,
>>
>>       Takaaki Ota <Takaaki.Ota@am.sony.com>
>
> The above table is illegal from the table.el definition point of view.

Ah, I should have seen this.  Thank you for your fast reply,
and sorry for the noise.

- Carsten

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: row and col spaning in table?
  2010-08-17  5:01         ` Carsten Dominik
@ 2010-08-17 23:51           ` Srinivas
  0 siblings, 0 replies; 11+ messages in thread
From: Srinivas @ 2010-08-17 23:51 UTC (permalink / raw)
  To: emacs-orgmode

Carsten,

As a follow up to Tak's response, this points to a potential bug in org-mode 
when converting tables from org-mode table to table.el table:

* Org Mode Table

| Header 1 | Header 2 |
| R1 C1-2             |
| R2 C1    | R2-3 C2  |
| R3 C1    |          |

* Org Mode Table converted to table.el table using C-c ~
+----------+----------+
| Header 1 | Header 2 |
+----------+----------+
| R1 C1-2             |
+---------------------+
| R2 C1    | R2-3 C2  |
+----------+----------+
| R3 C1    |          |
+----------+----------+

The second table is a result of hitting C-c ~ on the first table. Notice there 
is no '+' at the intersection at R1 C1-2, R2 C1 and R2-3 C2

It should be:

+----------+----------+
| R1 C1-2             |
+----------+----------+
| R2 C1    | R2-3 C2  |
+----------+----------+
| R3 C1    |          |
+----------+----------+


Even after fixing the '+', the output is not the same as the one produced by 
table.el. Since I don't know quite how to debug in Emacs, I can only go by the 
produced output.

Table.el produces the following for the corrected table:

Input:
+----------+----------+
| Header 1 | Header 2 |
+----------+----------+
| R1 C1-2             |
+----------+----------+
| R2 C1    | R2-3 C2  |
+----------+          |
| R3 C1    |          |
+----------+----------+

Table.el - table-generate-source (html) output:

<table border="1">
  <caption>Table</caption>
  <tr>
    <td align="center" valign="top">
       Header 1 
    </td>
    <td align="center" valign="top">
       Header 2 
    </td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top">
       R1 C1-2             
    </td>
  </tr>
  <tr>
    <td align="left" valign="top">
       R2 C1    
    </td>
    <td rowspan="2" align="center" valign="top">
       R2-3 C2  <br />
                <br />
                
    </td>
  </tr>
  <tr>
    <td align="left" valign="top">
       R3 C1    
    </td>
  </tr>
</table>

Orgmode output:

<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<tr><th scope="col">Header 1</th>
<th scope="col">Header 2</th></tr>
<tr><td>R1 C1-2</td></tr>
<tr><td>R2 C1<br/>R3 C1</td>
<td>R2-3 C2<br/></td></tr>
</table>


I know this is probably not a high priority issue/bug but I am posting the 
information here for completeness.

Thanks again for you all your feedback.
- Srinivas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: row and col spaning in table?
  2010-07-28  7:22 ` Giovanni Ridolfi
  2010-07-28 18:28   ` Srinivas
@ 2010-08-18  7:32   ` Christian Moe
  2010-08-18  7:58     ` David Hajage
  2010-08-20 14:08     ` Carsten Dominik
  1 sibling, 2 replies; 11+ messages in thread
From: Christian Moe @ 2010-08-18  7:32 UTC (permalink / raw)
  To: Giovanni Ridolfi; +Cc: David Hajage, emacs-orgmode, Carsten Dominik

Giovanni Ridolfi wrote:
> David Hajage <dhajage@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 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.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: row and col spaning in table?
  2010-08-18  7:32   ` Christian Moe
@ 2010-08-18  7:58     ` David Hajage
  2010-08-20 14:08     ` Carsten Dominik
  1 sibling, 0 replies; 11+ messages in thread
From: David Hajage @ 2010-08-18  7:58 UTC (permalink / raw)
  To: mail; +Cc: emacs-orgmode, Carsten Dominik


[-- Attachment #1.1: Type: text/plain, Size: 3569 bytes --]

Well, it seems a good solution to me!
David


On Wed, Aug 18, 2010 at 09:32, Christian Moe <mail@christianmoe.com> wrote:

> Giovanni Ridolfi wrote:
>
>> David Hajage <dhajage@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
>> 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.
>
>

[-- Attachment #1.2: Type: text/html, Size: 4383 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: row and col spaning in table?
  2010-08-18  7:32   ` Christian Moe
  2010-08-18  7:58     ` David Hajage
@ 2010-08-20 14:08     ` Carsten Dominik
  2010-08-20 14:24       ` Christian Moe
  1 sibling, 1 reply; 11+ messages in thread
From: Carsten Dominik @ 2010-08-20 14:08 UTC (permalink / raw)
  To: mail; +Cc: David Hajage, emacs-orgmode


On Aug 18, 2010, at 9:32 AM, Christian Moe wrote:

> Giovanni Ridolfi wrote:
>> David Hajage <dhajage@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 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:

Hi Christian,

I am willing to offer a hook for this post processing, buy you would  
have to write the code yourself.

- Carsten


>
> #+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.
>

- Carsten

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: row and col spaning in table?
  2010-08-20 14:08     ` Carsten Dominik
@ 2010-08-20 14:24       ` Christian Moe
  0 siblings, 0 replies; 11+ messages in thread
From: Christian Moe @ 2010-08-20 14:24 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: David Hajage, emacs-orgmode

Carsten Dominik wrote:
> 
> On Aug 18, 2010, at 9:32 AM, Christian Moe wrote:
(...)
>>  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.)
(...)
> 
> Hi Christian,
> 
> I am willing to offer a hook for this post processing, buy you would 
> have to write the code yourself.
> 
> - Carsten

Hi, Carsten,

That's nice. I'll take you up on the offer if and when I get around to 
scratching this itch, but it probably won't be anytime soon.

Yours,
Christian

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-08-20 14:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-26 11:55 row and col spaning in table? David Hajage
2010-07-28  7:22 ` Giovanni Ridolfi
2010-07-28 18:28   ` Srinivas
2010-08-16 12:45     ` Carsten Dominik
2010-08-16 21:24       ` Tak Ota
2010-08-17  5:01         ` Carsten Dominik
2010-08-17 23:51           ` Srinivas
2010-08-18  7:32   ` Christian Moe
2010-08-18  7:58     ` David Hajage
2010-08-20 14:08     ` Carsten Dominik
2010-08-20 14:24       ` Christian Moe

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).