Carsten Dominik <carsten.domi...@gmail.com> 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

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to