emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Sebastian Rose <sebastian_rose@gmx.de>
Cc: Org-mode ml <emacs-orgmode@gnu.org>
Subject: Re: Re: Aligning Columns in HTML Export Tables
Date: Mon, 25 Oct 2010 08:48:06 +0200	[thread overview]
Message-ID: <4D0BED2E-2674-4EA7-8B85-E7A9179D9CDD@gmail.com> (raw)
In-Reply-To: <87zku4emk5.fsf@gmx.de>


On Oct 23, 2010, at 9:28 PM, Sebastian Rose wrote:

> Carsten Dominik <carsten.dominik@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; }

I am actually using right now:

th.right  { text-align:center;  }
th.left   { text-align:center;   }
th.center { text-align:center; }

because is seem right to me that a table header is centrally
aligned even if the fields are lift or right aligned.
Does anyone know enough rules of style to tell me
if this is the right way, of if header fields are supposed
to have the same alignments as the data fields?

>> 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?

So you are suggesting I should add these
to the style sheet.  Sounds fine to me, with the
limitation that it might interfere with commonly
used classes?

I prefer to have at least the th.left/right/center in addition
due to the fact that I think I like centered headers.

>
> 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;}

Did it ever do this?  I don't think so, because the documentation
of the corresponding variables is explicit about the fact that you need
to put the <style> tags.
The reason here is that you might want to put

#+STYLE: <link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css 
\">

where automatic <style> tags would be problematic.

I think you can do it like this:

#+STYLE: <style>
#+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;}
#+STYLE: </style>


- Carsten

>
> * 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	other threads:[~2010-10-25  8:08 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-20 16:42 Aligning Columns in HTML Export Tables Jeff Horn
2010-10-20 17:16 ` Bernt Hansen
2010-10-20 19:04   ` Christian Moe
2010-10-20 20:11     ` Jeff Horn
2010-10-21  0:25   ` Sebastian Rose
2010-10-21  7:36     ` Christian Moe
2010-10-21  7:46       ` Carsten Dominik
2010-10-21 13:04         ` Sebastian Rose
2010-10-21 13:25           ` Sebastian Rose
2010-10-22  7:32   ` Carsten Dominik
2010-10-22 11:20     ` Sebastian Rose
2010-10-22 11:27       ` Carsten Dominik
2010-10-22 13:59         ` Sebastian Rose
2010-10-22 15:41           ` Carsten Dominik
2010-10-22 19:30             ` Sebastian Rose
2010-10-23  5:42               ` Carsten Dominik
2010-10-23 19:03                 ` Sebastian Rose
2010-10-22 19:37             ` Sebastian Rose
2010-10-23  5:53               ` Carsten Dominik
2010-10-23 19:20                 ` Sebastian Rose
2010-10-23 19:28                 ` Sebastian Rose
2010-10-25  6:48                   ` Carsten Dominik [this message]
2010-10-25  9:02                     ` Giovanni Ridolfi
2010-10-25  9:09                       ` Carsten Dominik
2010-10-25  4:36     ` Baoqiu Cui
2010-10-25  8:51       ` Christian Moe
2010-10-25  9:08         ` Carsten Dominik
2010-10-25 13:13           ` Christian Moe
2010-10-25 13:22             ` Carsten Dominik
2010-10-25 14:55               ` Sebastian Rose
2010-10-25 20:41                 ` Christian Moe
2010-10-25 21:52                 ` Baoqiu Cui
2010-10-26  5:11                   ` Carsten Dominik
2010-10-26 16:03                     ` Baoqiu Cui
2010-10-25 13:43             ` Carsten Dominik
2010-10-25 20:04               ` Christian Moe
2010-10-25 21:39                 ` Sebastian Rose
2010-10-26  5:12                   ` Carsten Dominik

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=4D0BED2E-2674-4EA7-8B85-E7A9179D9CDD@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=sebastian_rose@gmx.de \
    /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).