From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: Aligning Columns in HTML Export Tables Date: Mon, 25 Oct 2010 15:22:25 +0200 Message-ID: References: <878w1svl7y.fsf@gollum.intra.norang.ca> <53D6BE6F-C152-45DE-B01B-89D50B4848BC@gmail.com> <4CC54506.2070501@christianmoe.com> <21BA9B33-4ACD-4B43-9EF8-84765DA7EC2E@gmail.com> <4CC58271.6050005@christianmoe.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=33381 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PANIn-0004lm-2a for emacs-orgmode@gnu.org; Mon, 25 Oct 2010 09:41:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PAN0Q-0002g9-5y for emacs-orgmode@gnu.org; Mon, 25 Oct 2010 09:22:31 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:59208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PAN0P-0002g4-Ta for emacs-orgmode@gnu.org; Mon, 25 Oct 2010 09:22:30 -0400 Received: by ewy25 with SMTP id 25so1545992ewy.0 for ; Mon, 25 Oct 2010 06:22:29 -0700 (PDT) In-Reply-To: <4CC58271.6050005@christianmoe.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: mail@christianmoe.com Cc: Bernt Hansen , Jeff Horn , Org-mode ml , Dan Davison , Baoqiu Cui On Oct 25, 2010, at 3:13 PM, Christian Moe wrote: > On 10/25/10 11:08 AM, Carsten Dominik wrote: >> >> 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 > > It's a subtle difference, and every way works, so I don't want to > waste more of your time. > > #+begin_rant > But yes, I think it /is/ better, for the same reason Sebastian > requested it: Setting class is the preferred way to make all cells > of that class custom-styleable by changing a single line in the > stylesheet. > > As I pointed out below, though, it's not the only way. CSS lets you > do the same, nearly as easily, if "align" is used instead of "class" > as Baoqiu Cui suggested; "class" is more future-proof (HTML5), > "align" more compact (the default is already defined). > > (Heck, come to think of it, Sebastian could have monospaced the left- > aligned column in his example even when Org set "style" on each > cell, using a selector like: > : td[style="text-align: left;"] { font-family: monospace; } > -- but that, I think, would be perverse.) > > Over-use of the style attribute to set styles locally works against > the purpose of CSS. The local style attribute should be used for > exceptions; general rules should be handled at a higher level of the > cascade. I agree. But in the context of text alignment in tables, not all browsers support styles specified for entire columns. I think it is ridiculous to have to specify the alignment (or a class) for each field, but the browser realities force me. OK, I will use class. I could make a special case for the docbook exporter...... > > Having to set /anything/ on each cell just to align a column is not > optimal either, but since some browsers don't honor colgroups, it's > the most robust way. :-) Just what I think. OK, a class it is. - Carsten >>>> >>>> td.right { font-family:monospace;text-align:right; } >>> >>> Using the "align" attribute as follows, >>> >>> >>> 1 >>> bar >>> text >>> >>> >>> 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 >> >> > > - Carsten