emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* export table html centered
@ 2009-08-15 16:57 henry atting
  2009-08-15 19:50 ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: henry atting @ 2009-08-15 16:57 UTC (permalink / raw)
  To: emacs-orgmode

That is what I am searching for: Is there a markup rule that puts org
tables centered on the resulting page when exported as html.
Seems that #+BEGIN_CENTER – #+END_CENTER does not do this, marking a
table like that solely leads to an error message:

progn: Args out of range: 84, 906


henry

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

* Re: export table html centered
  2009-08-15 16:57 export table html centered henry atting
@ 2009-08-15 19:50 ` Nick Dokos
  2009-08-16  1:13   ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2009-08-15 19:50 UTC (permalink / raw)
  To: henry atting; +Cc: emacs-orgmode

henry atting <nsmp_01@online.de> wrote:

> That is what I am searching for: Is there a markup rule that puts org
> tables centered on the resulting page when exported as html.
> Seems that #+BEGIN_CENTER – #+END_CENTER does not do this, marking a
> table like that solely leads to an error message:
> 
> progn: Args out of range: 84, 906
> 
> 

Version info: Org-mode version 6.29trans
              GNU Emacs 23.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.12.9) of 2009-08-09 on gamaville.dokosmarshall.org

I don't get an error using #+BEGIN_CENTER/#+END_CENTER, but otoh I also
don't get a centered table: it's meant for centered paragraphs I think.

The align= attribute for a table is deprecated and I don't know what
the currently recommended method is (probably CSS - but I don't know much
about that). But if you don't mind using deprecated attributes, and assuming
you want *every* table centered, then customizing

    org-export-table-header-tags

to add 

    align="center"

should do it. You can also use #+BIND to do it per-file:

,----
| #+BIND: org-export-html-table-tag   "<table align=\"center\" border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\" frame=\"hsides\">"
| | foo | bar |
| |-----+-----|
| | 1   | 2   |
| | 2   | 5   |
| | 3   | 10  |
`----

HTH,
Nick


        

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

* Re: export table html centered
  2009-08-15 19:50 ` Nick Dokos
@ 2009-08-16  1:13   ` Nick Dokos
  2009-08-16  5:06     ` Carsten Dominik
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2009-08-16  1:13 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode, henry atting

Nick Dokos <nicholas.dokos@hp.com> wrote:

> ...  But if you don't mind using deprecated attributes, and assuming
> you want *every* table centered, then customizing
> 
>     org-export-table-header-tags
> 
> ...

Correction: that should be

     org-export-html-table-tag

Sorry about that - the BIND version below is correct.

> should do it. You can also use #+BIND to do it per-file:
> 
> ,----
> | #+BIND: org-export-html-table-tag   "<table align=\"center\" border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\" frame=\"hsides\">"
> | | foo | bar |
> | |-----+-----|
> | | 1   | 2   |
> | | 2   | 5   |
> | | 3   | 10  |
> `----

Thanks,
Nick

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

* Re: export table html centered
  2009-08-16  1:13   ` Nick Dokos
@ 2009-08-16  5:06     ` Carsten Dominik
  2009-08-16 10:22       ` henry atting
  0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2009-08-16  5:06 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode, henry atting

Hi Henry, Nick,

another way would be this:

     #+STYLE: <style>table.center {margin-left:auto; margin- 
right:auto;}</style>

     * A centered table

     #+ATTR_HTML: class="center"
     | a | b | c |
     |---+---+---|
     | 1 | 2 | 3 |

     * An uncentered table

     | a | b | c |
     |---+---+---|
     | 1 | 2 | 3 |


You can also configure org-export-html-table-tag to add the  
class="center"
if you want to center all tables.

HTH

- Carsten

On Aug 16, 2009, at 3:13 AM, Nick Dokos wrote:

> Nick Dokos <nicholas.dokos@hp.com> wrote:
>
>> ...  But if you don't mind using deprecated attributes, and assuming
>> you want *every* table centered, then customizing
>>
>>    org-export-table-header-tags
>>
>> ...
>
> Correction: that should be
>
>     org-export-html-table-tag
>
> Sorry about that - the BIND version below is correct.
>
>> should do it. You can also use #+BIND to do it per-file:
>>
>> ,----
>> | #+BIND: org-export-html-table-tag   "<table align=\"center\"  
>> border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\"  
>> frame=\"hsides\">"
>> | | foo | bar |
>> | |-----+-----|
>> | | 1   | 2   |
>> | | 2   | 5   |
>> | | 3   | 10  |
>> `----
>
> Thanks,
> Nick
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: 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] 5+ messages in thread

* Re: export table html centered
  2009-08-16  5:06     ` Carsten Dominik
@ 2009-08-16 10:22       ` henry atting
  0 siblings, 0 replies; 5+ messages in thread
From: henry atting @ 2009-08-16 10:22 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode, henry atting

On So, Aug 16 2009, Carsten Dominik wrote:

> Hi Henry, Nick,
>
> another way would be this:
>
>     #+STYLE: <style>table.center {margin-left:auto; margin-
> right:auto;}</style>
>
>     * A centered table
>
>     #+ATTR_HTML: class="center"
>     | a | b | c |
>     |---+---+---|
>     | 1 | 2 | 3 |
>
>     * An uncentered table
>
>     | a | b | c |
>     |---+---+---|
>     | 1 | 2 | 3 |
>
>
> You can also configure org-export-html-table-tag to add the
> class="center"
> if you want to center all tables.
>
> HTH
>
> - Carsten
>
> On Aug 16, 2009, at 3:13 AM, Nick Dokos wrote:
>
>> Nick Dokos <nicholas.dokos@hp.com> wrote:
>>
>>> ...  But if you don't mind using deprecated attributes, and assuming
>>> you want *every* table centered, then customizing
>>>
>>>    org-export-table-header-tags
>>>
>>> ...
>>
>> Correction: that should be
>>
>>     org-export-html-table-tag
>>
>> Sorry about that - the BIND version below is correct.
>>
>>> should do it. You can also use #+BIND to do it per-file:
>>>
>>> ,----
>>> | #+BIND: org-export-html-table-tag   "<table align=\"center\"
>>> border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\"
>>> frame=\"hsides\">"
>>> | | foo | bar |
>>> | |-----+-----|
>>> | | 1   | 2   |
>>> | | 2   | 5   |
>>> | | 3   | 10  |
>>> `----
>>
>> Thanks,
>> Nick

Hi Nick, hi Dominik,

as I have my own stylesheet I did not deal with the #+STYLE option to
much. But it's very helpful, great.

Many thanks
henry

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

end of thread, other threads:[~2009-08-16 10:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-15 16:57 export table html centered henry atting
2009-08-15 19:50 ` Nick Dokos
2009-08-16  1:13   ` Nick Dokos
2009-08-16  5:06     ` Carsten Dominik
2009-08-16 10:22       ` henry atting

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