emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: export a org table to ascii format (tabs) are not conserved, culprit orgtbl-to-tsv?
Date: Tue, 31 May 2022 07:10:37 +1000	[thread overview]
Message-ID: <87bkve3eeu.fsf@gmail.com> (raw)
In-Reply-To: <871qwbc98q.fsf@mat.ucm.es>


Uwe Brauer <oub@mat.ucm.es> writes:

> Hi
>
> I wanted to export a 4x4 table to ascii to insert it into a web fill in
> interface. However the column get distorted. I tried to tabify or
> untabify the buffer but it did not help.
>
>
> The problem also occurs when I export the table using the 
> orgtbl-to-tsv
>
> #+begin_example
> | Course                       |           L |           M |           X |           J |           V |
> |------------------------------+-------------+-------------+-------------+-------------+-------------|
> | Statistics                   | 10:30-11:30 |             | 10:00-11:20 |             | 10:30-11:30 |
> | Differential Equations       | 12:30-13:30 |             | 13:00-14:15 |             | 12:30-13:30 |
> | Master                       | 14:30-15:30 |             | 15:30-16:30 | 14:30-15:30 |             |
> | Numerical Analysis :00-19:00 | 18:00-19:00 | 18:00-19:00 | 18:00-19:00 |             |         7.5 |
> |                              |             |             |             | 19:00-20:00 |             |
> |------------------------------+-------------+-------------+-------------+-------------+-------------|
> |                              |             |             |             |             |             |
>
> #+end_example
>
>
> Converted to 
>
> #+begin_example
> Course	L	M	X	J	V
> Statistics	10:30-11:30		10:00-11:20		10:30-11:30
> Differential Equations	12:30-13:30		13:00-14:15		12:30-13:30
> Master	14:30-15:30		15:30-16:30	14:30-15:30	
> Numerical Analysis	18:00-19:00	18:00-19:00	18:00-19:00	18:00-19:00	
> 				19:00-20:00	
> #+end_example
>
>
> Any idea what is wrong here?
>
>

I think you might be working under a false expectation. A quick look at
the exported table example and it looks to be correct to me - values are
tab separated, with is what a tsv format is. There is no requirement
that the columns should be aligned, only that they are separated by
tabs. 

With regards to more formatted output options, a common issue is with
respect to the fonts people use. If the font being used to view th
eoutput is a proportional font rather than a fixed width one, then all
formatting will be broken. Most web interfaces tend to use proportional
fonts due to their more pleasing look for most people. This is also why
tables sent via email often don't look right for the recipient - they
are using a proportional or condensed font. 

As you have no control over the fonts used by those viewing your ASCII
content, you cannot reliably make it look well formatted. Either you
have to do HTML, some form of markdown or some other format with
enforces tgable alignment.  

If your entering data into a web UI, I would not have any expectations
regarding the final formatting as that will depend heavily on what the
backend does to the supplied input and how the data is presented to
anyone looking at that output. 


  parent reply	other threads:[~2022-05-30 21:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-30 15:48 export a org table to ascii format (tabs) are not conserved, culprit orgtbl-to-tsv? Uwe Brauer
2022-05-30 16:06 ` Eric S Fraga
2022-05-30 21:10 ` Tim Cross [this message]
2022-05-31  1:14   ` Samuel Wales
2022-05-31  1:16     ` Samuel Wales
2022-05-31 12:14   ` Uwe Brauer

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=87bkve3eeu.fsf@gmail.com \
    --to=theophilusx@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).