all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug with automatic alignment of table columns in HTML export
@ 2013-03-17 15:08 Kodi Arfer
  2013-03-19 17:26 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Kodi Arfer @ 2013-03-17 15:08 UTC (permalink / raw)
  To: emacs-orgmode

Consider an Org file with the following content:

|   a | b |
|-----+---|
| 100 | 1 |
|   1 | 1 |
|     | 1 |
|     | 1 |
|     | 1 |
|     | 1 |
|     | 1 |
|     | 1 |

Within Emacs, Org right-aligns the left column, as it should, since most 
nonempty cells in the column are numeric. In HTML export, though 
(starting from "emacs -Q -l /tmp/minimal-org.el"), the column comes out 
left-aligned. The problem seems to be with how the exporter treats empty 
cells, since if you put numbers in all the empty cells above, the column 
comes out right-aligned in HTML export.

Emacs  : GNU Emacs 24.1.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.12)
  of 2012-09-22 on batsu, modified by Debian
Package: Org-mode version 7.9.4 (7.9.4-dist @ 
/usr/share/emacs/site-lisp/org/)

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

* Re: Bug with automatic alignment of table columns in HTML export
  2013-03-17 15:08 Bug with automatic alignment of table columns in HTML export Kodi Arfer
@ 2013-03-19 17:26 ` Bastien
  2013-03-19 19:39   ` Kodi Arfer
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2013-03-19 17:26 UTC (permalink / raw)
  To: Kodi Arfer; +Cc: emacs-orgmode

Hi Kodi,

Kodi Arfer <kodi@arfer.net> writes:

> Consider an Org file with the following content:
>
> |   a | b |
> |-----+---|
> | 100 | 1 |
> |   1 | 1 |
> |     | 1 |
> |     | 1 |
> |     | 1 |
> |     | 1 |
> |     | 1 |
> |     | 1 |
>
> Within Emacs, Org right-aligns the left column, as it should, since most
> nonempty cells in the column are numeric. In HTML export, though (starting
> from "emacs -Q -l /tmp/minimal-org.el"), the column comes out
> left-aligned. The problem seems to be with how the exporter treats empty
> cells, since if you put numbers in all the empty cells above, the column
> comes out right-aligned in HTML export.

Fixed, thanks.

-- 
 Bastien

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

* Re: Bug with automatic alignment of table columns in HTML export
  2013-03-19 17:26 ` Bastien
@ 2013-03-19 19:39   ` Kodi Arfer
  2013-04-06  0:48     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Kodi Arfer @ 2013-03-19 19:39 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

On 2013 Mar 19 Tue 1:26:13 PM -0400, Bastien <bzg@altern.org> wrote:
> Hi Kodi,
>
> Kodi Arfer <kodi@arfer.net> writes:
>
>> Consider an Org file with the following content:
>>
>> |   a | b |
>> |-----+---|
>> | 100 | 1 |
>> |   1 | 1 |
>> |     | 1 |
>> |     | 1 |
>> |     | 1 |
>> |     | 1 |
>> |     | 1 |
>> |     | 1 |
>>
>> Within Emacs, Org right-aligns the left column, as it should, since most
>> nonempty cells in the column are numeric. In HTML export, though (starting
>> from "emacs -Q -l /tmp/minimal-org.el"), the column comes out
>> left-aligned. The problem seems to be with how the exporter treats empty
>> cells, since if you put numbers in all the empty cells above, the column
>> comes out right-aligned in HTML export.
>
> Fixed, thanks.

You're quite welcome. That was prompt! I see this case now works in 
master. The catch is that there are still some cases which give 
inconsistent alignment between Emacs and HTML export, such as:

|   a | b |
|-----+---|
| 100 | 1 |
|   1 | 1 |
|   1 | 1 |
|   1 | 1 |
|   a | 1 |
|     | 1 |
|     | 1 |
|     | 1 |
|     | 1 |
|     | 1 |
|     | 1 |

I believe the heuristic used for in-buffer display is that empty cells 
are ignored entirely when doing the comparison against 
org-table-number-fraction.

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

* Re: Bug with automatic alignment of table columns in HTML export
  2013-03-19 19:39   ` Kodi Arfer
@ 2013-04-06  0:48     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2013-04-06  0:48 UTC (permalink / raw)
  To: Kodi Arfer; +Cc: emacs-orgmode

Hi Kodi,

Kodi Arfer <kodi@arfer.net> writes:

> You're quite welcome. That was prompt! I see this case now works in
> master. The catch is that there are still some cases which give
> inconsistent alignment between Emacs and HTML export, such as:
>
> |   a | b |
> |-----+---|
> | 100 | 1 |
> |   1 | 1 |
> |   1 | 1 |
> |   1 | 1 |
> |   a | 1 |
> |     | 1 |
> |     | 1 |
> |     | 1 |
> |     | 1 |
> |     | 1 |
> |     | 1 |

For such cases, you can use this:

| <r> | <r> |
|   a |   b |
|-----+-----|
| 100 |   1 |
|   1 |   1 |
|   1 |   1 |
|   1 |   1 |
|   a |   1 |
|     |   1 |
|     |   1 |
|     |   1 |
|     |   1 |
|     |   1 |
|     |   1 |

HTH,

-- 
 Bastien

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

end of thread, other threads:[~2013-04-06  0:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-17 15:08 Bug with automatic alignment of table columns in HTML export Kodi Arfer
2013-03-19 17:26 ` Bastien
2013-03-19 19:39   ` Kodi Arfer
2013-04-06  0:48     ` Bastien

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.