emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: org table proposal: merge and split cells in org-tables
Date: Mon, 31 Oct 2022 08:56:26 +0300	[thread overview]
Message-ID: <Y19jilSK8sv16dfh@protected.localdomain> (raw)
In-Reply-To: <87leoxoe75.fsf@localhost>

* Ihor Radchenko <yantar92@posteo.net> [2022-10-30 12:27]:
> Jean Louis <bugs@gnu.support> writes:
> 
> > To solve that problem personally, I use Asciidoctor, see how it is
> > done there:
> >
> > Example 76. Table with formatted, aligned and merged cells:
> > https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/#ex-cell-format
> 
> I am sorry, but this looks unreadable. I would avoid re-using such
> syntax ideas.

You have got an extreme reference on what can be done. Other people
and other projects have faced same issues as you are facing in Org
mode, and have resolved it. To understand anything one cannot just
read simple reference, but better understand the surrounding meanings,
the context.

Org tables are nothing harder or simpler than tables in other
lightweight markup languages.

What appears "unreadable" to you is readable to other
person. In fact, there is no single char in the extreme example of
Asciidoc table below that you can't read. The meaning of
"unreadable" is most probably "not understandable". That is why I
said, one has to inspect the context and look for definitions.

[cols="e,m,^,>s",width="25%"]
|===
|1 >s|2 |3 |4
^|5 2.2+^.^|6 .3+<.>m|7
^|8
|9 2+>|10nnp
|===

In fact, looking into functionality of other lightweigh markup
languages may only be helpful for Org development.

For [cols="e,m,^p,>s",width="25%"] look here:
https://docs.asciidoctor.org/asciidoc/latest/tables/format-column-content/

Thus `e' before first comma, means emphasized (I guess) and in fact on
the original demonstration one can see that first column is
emphasized. 

The fact that one may "describe" column's font style in Asciidoc(tor)  could
be adopted as well in Org mode.

`m' after first comma says that text of that column shall be in
monospaced font, which I find very useful for table columns.

`^' signifies centered column in `[cols="e,m,^,>s",width="25%"]'

and `>s' means right centered, bold column;

`width=25%' tells about table width.

I would like it if Org mode could provide such functionality for
tables, to specify various attributes for columns. It does provide,
though I am not sure if it can provide so many.

And in that extreme example then we have following lines:

|===
for begin of the table

|1 >s|2 |3 |4
the second `|' has attribute `>s' or complete `>s|' which specifically
formats number "2" to be bold and right centered. 

^|5 2.2+^.^|6 .3+<.>m|7

It is good to read about span factor:
https://docs.asciidoctor.org/asciidoc/latest/tables/span-cells/

2.2+^.^|6 -- talks about spanning 2 columns, two rows and its alignment.

while .3+<.>m|7 talks about spanning 3 rows, that is where number 7 comes.

|===
for end of the table

It is surely good to try to make visual tables with merged cells as
general Org functionality. 

It is also very useful to look how other people implement various
functionalities and try to see if such could be useful in Org as well.

But when you don't have the functionality yet, due to the Babel and
inclusion of other files, one may achieve the final result by
including HTML directly, or by using external tools.

Org is integrator of almost anything. Babel and integration of, to the
Org external tools, allows user to include almost any value or results
from outside the file.

I do agree that it is "hard" to understand at once what it is, but it
is a solution for reason that Org allows external tools' values to be
included in the Org file. In this case it is the HTML output from
Asciidoctor. 

This elaboration is for opening the mind of Org user, it is to
understand that extensibility, due to Babel and inclusion of any
external tools has no limits at any point of time.

One need not wait for that feature X to be implemented in Org, while
there is plenty of available options to reach the purpose of feature
X.

#+BEGIN_SRC shell :results raw
echo "
[cols=\"e,m,^,>s\",width=\"25%\"]
|===
|1 >s|2 |3 |4
^|5 2.2+^.^|6 .3+<.>m|7
^|8
|9 2+>|10nnp
|===
" | asciidoctor -e -o - -

#+END_SRC

#+RESULTS:
<table class="tableblock frame-all grid-all" style="width: 25%;">
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><em>1</em></p></td>
<td class="tableblock halign-right valign-top"><p class="tableblock"><strong>2</strong></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock">3</p></td>
<td class="tableblock halign-right valign-top"><p class="tableblock"><strong>4</strong></p></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><em>5</em></p></td>
<td class="tableblock halign-center valign-middle" colspan="2" rowspan="2"><p class="tableblock"><code>6</code></p></td>
<td class="tableblock halign-left valign-bottom" rowspan="3"><p class="tableblock"><code>7</code></p></td>
</tr>
<tr>
<td class="tableblock halign-center valign-top"><p class="tableblock"><em>8</em></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><em>9</em></p></td>
<td class="tableblock halign-right valign-top" colspan="2"><p class="tableblock"><code>10nnp</code></p></td>
</tr>
</tbody>
</table>

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


  reply	other threads:[~2022-10-31  5:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-29 16:53 org table proposal: merge and split cells in org-tables Uwe Brauer
2022-10-30  3:54 ` Ihor Radchenko
2022-10-30  7:22   ` Uwe Brauer
2022-10-30  9:13 ` Jean Louis
2022-10-30  9:25   ` Ihor Radchenko
2022-10-31  5:56     ` Jean Louis [this message]
2022-10-31  8:50       ` Ihor Radchenko
2022-10-30  9:13 ` Timothy
2022-11-04  7:38 ` Max Nikulin
2022-11-05  5:44   ` Ihor Radchenko
  -- strict thread matches above, loose matches on Subject: below --
2022-10-30  8:23 Mati
2022-10-30  8:35 ` Ihor Radchenko
2022-10-30  8:47   ` Timothy
2022-10-30  8:56     ` Ihor Radchenko
2022-10-30  9:08       ` Timothy

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=Y19jilSK8sv16dfh@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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).