emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: Aligning Columns in HTML Export Tables


From: Sebastian Rose
Subject: Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Date: Sat, 23 Oct 2010 21:28:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Carsten Dominik <address@hidden> writes:
> I have now in the default style:
>
>   td, th { vertical-align: top;  }
>   th.right  { text-align:right;  }
>   th.left   { text-align:left;   }
>   th.center { text-align:center; }
>   td.right  { text-align:right;  }
>   td.left   { text-align:left;   }
>   td.center { text-align:center; }
>
> Is there a way to write this more compactly?
>
> - Carsten


But this is, what I often use:

  /* Aligns block elements, too: */
  .right  {margin-left:auto; margin-right:0px;  text-align:right;}
  .left   {margin-left:0px;  margin-right:auto; text-align:left;}
  .center {margin-left:auto; margin-right:auto; text-align:center;}

These are CSS classes I use frequently.  It works for all HTML elements
AND aligns table to the right in all important browsers.  I first
thought "OK, we can do this ourselves per stylesheet", but why not offer
this little goodie out-of-the-box?

Try:


(THERE'S A BUG: #+STYLE: lines are not wrapped in <style> tags anymore) 


--8<---------------cut here---------------start------------->8---
#+STYLE:  .right  {margin-left:auto; margin-right:0px;  text-align:right;}
#+STYLE:  .left   {margin-left:0px;  margin-right:auto; text-align:left;}
#+STYLE:  .center {margin-left:auto; margin-right:auto; text-align:center;}

* Tables

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

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

#+ATTR_HTML: class="right"
| a | b | c |
|---+---+---|
| 1 | 2 | 3 |
--8<---------------cut here---------------end--------------->8---



   Sebastian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]