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: Carsten Dominik
Subject: Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Date: Mon, 25 Oct 2010 11:08:15 +0200


On Oct 25, 2010, at 10:51 AM, Christian Moe wrote:

On 10/25/10 6:36 AM, Baoqiu Cui wrote:
I am wondering if there
is any special reason to use "class" instead of "align". If not, can we
change the elisp code to use "align"?

I believe the "align" attribute is slated for obsoletion in HTML5, on the grounds that it's better handled by CSS.

http://www.w3.org/TR/html5/obsolete.html

It's a reason to go with "class" instead. Not a compelling one, perhaps.

My only strong opinion on this is that I absolutely agree with the choice not to set the "style" attribute locally on each table cell.

Hmm, butwe do now set the class in each cell.  Is that any better?

- Carsten


But Sebastian Rose's request that prompted it, /could/ equally well be addressed with the "align" attribute:

How about this (line-wrapped for readability):


<tr>
<td class="right">1</td>
<td class="left">bar</td>
<td class="left">text</td>
<tr>

instead of

<tr>
<td style="text-align:right">1</td>
<td style="text-align:left">bar</td>
<td style="text-align:left">text</td>
<tr>

??


Combined with the ways to add IDs and classes to tables, we could then style the
columns better.

I would like to set this for right aligned <td> tags as default:

 td.right { font-family:monospace;text-align:right; }

Using the "align" attribute as follows,

<tr>
<td align="right">1</td>
<td align="left">bar</td>
<td align="left">text</td>
<tr>

Sebastian could achieve the same with CSS like

td[align="right"]  { font-family: monospace;}

In the same way one could even use CSS to override the alignment specified by the "align" attribute, if for whatever reason this seemed like a good idea...

One slight advantage of the "align" attribute over "class" is that it doesn't require the default style to contain the extra verbiage Carsten mentioned:

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?

Yours,
Christian

- Carsten






reply via email to

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