Re: [Orgmode] row and col spaning in table?
On Aug 18, 2010, at 9:32 AM, Christian Moe wrote: Giovanni Ridolfi wrote: David Hajage dhaj...@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$...@1$4::@2$...@3$2::@4$...@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 ___ 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
Re: [Orgmode] row and col spaning in table?
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 ___ 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
Re: [Orgmode] row and col spaning in table?
Giovanni Ridolfi wrote: David Hajage dhaj...@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$...@1$4::@2$...@3$2::@4$...@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. ___ 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
Re: [Orgmode] row and col spaning in table?
Well, it seems a good solution to me! David On Wed, Aug 18, 2010 at 09:32, Christian Moe m...@christianmoe.com wrote: Giovanni Ridolfi wrote: David Hajage dhaj...@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$...@1$4::@2$...@3$2::@4$...@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. ___ 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
Re: [Orgmode] row and col spaning in table?
David Hajage dhaj...@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 ___ 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
[Orgmode] row and col spaning in table?
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 ___ 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