Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
On Oct 25, 2010, at 11:52 PM, Baoqiu Cui wrote: Sebastian Rose sebastian_r...@gmx.de writes: Carsten Dominik carsten.domi...@gmail.com writes: OK, I will use class. I could make a special case for the docbook exporter.. +1 +1 for making a special case for the docbook exporter. :-) (DocBook documents can be rendered in different formats, some of which (like PDF) may know nothing about CSS.) BTW: Org mode's exports to XHTML, not HTML 4.01 or HTML 5 (which is a proposal, not a standard or recommendation yet). Still, 'td align=right' is valid XHTML, too. Maybe we should add a parameter to function org-format-org-table- html to indicate whether we want to format pure standard XHTML tables that do not use class or CSS related stuff. This is exactly how I have done it now. - Carsten Thanks, -- Baoqiu ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
OK, I think this change is now done. Thank you all for sharing your expertise! - Carsten On Oct 25, 2010, at 11:39 PM, Sebastian Rose wrote: Christian Moe m...@christianmoe.com writes: Maybe someone with a browser where colgroups actually do work (Opera!) can check 1. if they only work with the align attribute, and not with CSS, and 2. whether they still work (take precedence) now that the individual cells are aligned with CSS for their class. They _never_ took precedence, as soon as I used a style like this: /* My default for all td elements */ td { text-align:left; } The `td' style will alway be a better CSS-match than the col's style or class attribute, even then the col's align attribute. It's even the expected behaviour according to CSS standards since that what's the `C' in CSS means. I have to remove my favourite default style for td elements from my stylesheet to make that work in Opera, too. In current FF it does not work at all. Here's another test: CSS: --8---cut here---start-8--- col.right { text-align:right;vertical-align:top;background- color:red; } col.left { text-align:left;vertical-align:top;background- color:green; } col.center { text-align:center;vertical-align:top;background- color:blue; } --8---cut here---end---8--- A table: --8---cut here---start-8--- table border=0 summary= caption/caption colgroupcol class=left /col class=center /col class=right / /colgroup thead trthA/ththB/ththC/th/tr /thead tbody trtd1/tdtd bar/tdtdtext/td/tr trtd12/tdtd test/tdtd300/td/tr trtd9/tdtd foo/tdtd4/td/tr /tbody /table --8---cut here---end---8--- The only `style' that works that way is the `background-color'. In Opera and FF at least. Means, the `class' attribute in col elements doesn't work very well (but 'col class=odd /col class=even /' might make sense with alternating colors).. Both, 'align' and the 'style' attribute will be overwritten by a default style for a td element in the users stylesheet (some prefere center, some left alignment as the default). It's common practice to have `style' or `class' attribute in td elements. That's what classes are for in the end. Make HTML elements members of a group with certain properties. Why not jut go with it? Look at `magento's code, Drupal, whatever. They even use more those usefull classes, e.g. `first' and `last' for the first and last elements of lists. HTML elements without classes are hard to find. The reason is, that HTML is just a document structure. Classes (and IDs) make those elements live. first last right left content footnote menu comment big small light dark pro contra - classes make the difference. Plus 'class=right' is easy to change in central place left entrirely to the user: the stylesheet. XML is not meant to avoid clutter. And if it was, something went terribly wrong, I guess :) 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Carsten Dominik carsten.domi...@gmail.com writes: On Oct 25, 2010, at 11:52 PM, Baoqiu Cui wrote: Sebastian Rose sebastian_r...@gmx.de writes: Carsten Dominik carsten.domi...@gmail.com writes: OK, I will use class. I could make a special case for the docbook exporter.. +1 +1 for making a special case for the docbook exporter. :-) (DocBook documents can be rendered in different formats, some of which (like PDF) may know nothing about CSS.) BTW: Org mode's exports to XHTML, not HTML 4.01 or HTML 5 (which is a proposal, not a standard or recommendation yet). Still, 'td align=right' is valid XHTML, too. Maybe we should add a parameter to function org-format-org-table- html to indicate whether we want to format pure standard XHTML tables that do not use class or CSS related stuff. This is exactly how I have done it now. Thanks for the quick change, Carsten! I just tested the latest code and everything looks good. -- Baoqiu ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
On Oct 23, 2010, at 9:28 PM, Sebastian Rose wrote: 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; } 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 ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
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. 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=right1/td td class=leftbar/td td class=lefttext/td tr instead of tr td style=text-align:right1/td td style=text-align:leftbar/td td style=text-align:lefttext/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=right1/td td align=leftbar/td td align=lefttext/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 ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
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=right1/td td class=leftbar/td td class=lefttext/td tr instead of tr td style=text-align:right1/td td style=text-align:leftbar/td td style=text-align:lefttext/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=right1/td td align=leftbar/td td align=lefttext/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 ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
On Oct 25, 2010, at 11:02 AM, Giovanni Ridolfi wrote: Carsten Dominik carsten.domi...@gmail.com writes: 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. yes, seems to be 'common sense' :-D [at least here in Italy(Europe) ;-)] 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? Headers are by default center aligned within table cells. [1] OK, thanks for this. - Carsten ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Carsten Dominik carsten.domi...@gmail.com writes: 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. yes, seems to be 'common sense' :-D [at least here in Italy(Europe) ;-)] 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? Headers are by default center aligned within table cells. [1] [1] http://www.mcu.org.uk/articles/tables.html cheers, Giovanni ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
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. 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. #+end_rant Christian 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=right1/td td class=leftbar/td td class=lefttext/td tr instead of tr td style=text-align:right1/td td style=text-align:leftbar/td td style=text-align:lefttext/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=right1/td td align=leftbar/td td align=lefttext/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 ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
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, tr td align=right1/td td align=leftbar/td td align=lefttext/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 - Carsten ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
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. 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. #+end_rant Christian 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=right1/td td class=leftbar/td td class=lefttext/td tr instead of tr td style=text-align:right1/td td style=text-align:leftbar/td td style=text-align:lefttext/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=right1/td td align=leftbar/td td align=lefttext/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 Actually, I have one more question: The exporter does now (in addition to setting classes for individual fields) colgroupcol align=left /col align=right /col align=center / Should this be classes instead of align attributes as well? Thanks! - Carsten - Carsten ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Carsten Dominik carsten.domi...@gmail.com writes: OK, I will use class. I could make a special case for the docbook exporter.. +1 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. How refer to all right-aligned `td' elements in a certain tables without some special attribute anyway. `class' preferred since this is CSS2 and will work in commen browsers. I'm not sure how which browsers will understand the selector `table#special td[align=right] {...}'. BTW: Org mode's exports to XHTML, not HTML 4.01 or HTML 5 (which is a proposal, not a standard or recommendation yet). Still, 'td align=right' is valid XHTML, too. ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Actually, I have one more question: The exporter does now (in addition to setting classes for individual fields) colgroupcol align=left /col align=right /col align=center / Should this be classes instead of align attributes as well? Thanks! - Carsten Maybe someone with a browser where colgroups actually do work (Opera!) can check 1. if they only work with the align attribute, and not with CSS, and 2. whether they still work (take precedence) now that the individual cells are aligned with CSS for their class. Unless the answer to both is yes, I'd say classes there too, to be consistent with what you're doing on cells (and where HTML5 seems to be heading). Christian ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
[Veering off-topic, just to round off a discussion] On 10/25/10 4:55 PM, Sebastian Rose wrote: How refer to all right-aligned `td' elements in a certain tables without some special attribute anyway. Fair point. (In an ideal world, as long as the whole column is right-aligned it should be enough to refer to all right-aligned `col' elements, but this clearly is not the case today.) `class' preferred since this is CSS2 and will work in commen browsers. I'm not sure how which browsers will understand the selector `table#special td[align=right] {...}'. Firefox, Safari, ... The attribute selector is CSS2, too. But I agree `class' is preferred. BTW: Org mode's exports to XHTML, not HTML 4.01 or HTML 5 (which is a proposal, not a standard or recommendation yet). Still, 'td align=right' is valid XHTML, too. Absolutely, I didn't mean to imply otherwise. But I think in this regard, at least, the thinking behind the HTML 5 proposal makes sense. (As for the relationship between HTML 5 and XHTML, let's not go there...) Christian ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Christian Moe m...@christianmoe.com writes: Maybe someone with a browser where colgroups actually do work (Opera!) can check 1. if they only work with the align attribute, and not with CSS, and 2. whether they still work (take precedence) now that the individual cells are aligned with CSS for their class. They _never_ took precedence, as soon as I used a style like this: /* My default for all td elements */ td { text-align:left; } The `td' style will alway be a better CSS-match than the col's style or class attribute, even then the col's align attribute. It's even the expected behaviour according to CSS standards since that what's the `C' in CSS means. I have to remove my favourite default style for td elements from my stylesheet to make that work in Opera, too. In current FF it does not work at all. Here's another test: CSS: --8---cut here---start-8--- col.right { text-align:right;vertical-align:top;background-color:red; } col.left { text-align:left;vertical-align:top;background-color:green; } col.center { text-align:center;vertical-align:top;background-color:blue; } --8---cut here---end---8--- A table: --8---cut here---start-8--- table border=0 summary= caption/caption colgroupcol class=left /col class=center /col class=right / /colgroup thead trthA/ththB/ththC/th/tr /thead tbody trtd1/tdtd bar/tdtdtext/td/tr trtd12/tdtd test/tdtd300/td/tr trtd9/tdtd foo/tdtd4/td/tr /tbody /table --8---cut here---end---8--- The only `style' that works that way is the `background-color'. In Opera and FF at least. Means, the `class' attribute in col elements doesn't work very well (but 'col class=odd /col class=even /' might make sense with alternating colors).. Both, 'align' and the 'style' attribute will be overwritten by a default style for a td element in the users stylesheet (some prefere center, some left alignment as the default). It's common practice to have `style' or `class' attribute in td elements. That's what classes are for in the end. Make HTML elements members of a group with certain properties. Why not jut go with it? Look at `magento's code, Drupal, whatever. They even use more those usefull classes, e.g. `first' and `last' for the first and last elements of lists. HTML elements without classes are hard to find. The reason is, that HTML is just a document structure. Classes (and IDs) make those elements live. first last right left content footnote menu comment big small light dark pro contra - classes make the difference. Plus 'class=right' is easy to change in central place left entrirely to the user: the stylesheet. XML is not meant to avoid clutter. And if it was, something went terribly wrong, I guess :) 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Sebastian Rose sebastian_r...@gmx.de writes: Carsten Dominik carsten.domi...@gmail.com writes: OK, I will use class. I could make a special case for the docbook exporter.. +1 +1 for making a special case for the docbook exporter. :-) (DocBook documents can be rendered in different formats, some of which (like PDF) may know nothing about CSS.) BTW: Org mode's exports to XHTML, not HTML 4.01 or HTML 5 (which is a proposal, not a standard or recommendation yet). Still, 'td align=right' is valid XHTML, too. Maybe we should add a parameter to function org-format-org-table-html to indicate whether we want to format pure standard XHTML tables that do not use class or CSS related stuff. Thanks, -- Baoqiu ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Carsten Dominik carsten.domi...@gmail.com writes: Baoqiu, (or any other users of the docbook exporter) I am not sure if the docbook format has suffered from this change, could you please run a few tests involving tables and report back? Thanks for supporting this new feature. DocBook exporter does not really suffer from this change, but it does not benefit from it either. After checking the documentation of DocBook and HTML table, it seems that using the class attribute in td elements for alignment is not the best solution. Attribute align is officially supported by DocBook and HTML based on the following two links: 1. http://docbook.org/tdg5/en/html/html.td.html 2. http://www.w3.org/TR/html401/struct/tables.html#h-11.3.2 If I change class to align in the following lines, the same table can be recognized by both Firefox and DocBook. 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? tbody trtd class=leftA/tdtd class=leftB/tdtd class=rightC/td/tr trtd class=left1/tdtd class=left2/tdtd class=right3/td/tr trtd class=left12/tdtd class=left13/tdtd class=right300/td/tr trtd class=left9/tdtd class=left11/tdtd class=right4/td/tr /tbody Thanks! -- Baoqiu ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Carsten Dominik carsten.domi...@gmail.com writes: OK, found it. It was in my .emacs which I didn't use for ages... But: colgroupcol align=right //colgroupcolgroupcol align=left //colgroupcolgroupcol align=left //colgroup must be: colgroupcol align=right /col align=left /col align=left //colgroup i.e. colgroup and /colgroup have to occur only once each and wrap the col ... / definitions. The /colgroup after each col ... / happens only for the second table. Hi Sebastian, Are you sure about this? Because the is special syntax for Org to define column groups, and I believe it is OK to have multiple column groups in a table. No I've checked, and it is indeed valid! Oups... I've never seen it anywhere Everything is fine then. Thanks again for the fix! 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Carsten Dominik carsten.domi...@gmail.com writes: How about this (line-wrapped for readability): tr td class=right1/td td class=leftbar/td td class=lefttext/td tr instead of tr td style=text-align:right1/td td style=text-align:leftbar/td td style=text-align:lefttext/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; } OK, fair enough. But I don't think I will make the monospace the Org default, it looks a bit odd. BUt of cause you can change this. Great! 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 No, if you don't want to remove all whitespace :) A, that's cool!!! Thank you!!! 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
On Oct 20, 2010, at 7:16 PM, Bernt Hansen wrote: Jeff Horn jrhorn...@gmail.com writes: Is there a way to specify a particular column in org-mode that will be exported right-aligned in HTML? | A | B | C | | 1 | 2 | 3 | For the table above, I would like column C right aligned when I export to HTML, but the other column aligned in the default way (left aligned?). I think this is supposed to work but it seems the exporters do not honour the alignment details. | l | l | r | | A | B | C | | 1 | 2 | 3 | | 12 | 13 | 300 | | 9 | 11 | 4 | I have now fixed this issue, at least for the HTML exporter. 1. The HTML exporter now puts a style attribute onto each individual field to make sure the field is aligned correctly. Many Browsers need this, as pointed out by Sebastian. If you do not like this overhead, you can configure org-export-html-table-align-individual-fields. If you do, the alignment will still be noted in the column tags, handled correctly by Opera, but not by Firefox and Safari. 2. The HTML exporter will also honor a c cookie. Note that this will not change anything inside an Org buffer - this would be complex to implement because of all the extra magic Org does with limited column width etc etc. 3. The LaTeX exporter does not yet honor c, while it does honor l and r. The reason for this is that currently the vector remembering the alignment is a vector of booleans, and larger changes are necessary in order to allow for a third value. This will come, but I do not have the time today. Eric and Dan, please take note of this change and make sure that the Babel routines do not get in trouble by this new cookie. Baoqiu, (or any other users of the docbook exporter) I am not sure if the docbook format has suffered from this change, could you please run a few tests involving tables and report back? Jeff, thanks for kicking this threat off, this is a nice improvement. Cheers - Carsten Cheers Regards, Bernt ___ 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 ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Hi Sebastian, my guess would be that you have customized the td and th tags? If yes, please reset the customization, you need the new default values (which you then can still modify). Please check the variables org-export-table-header-tags and org-export-table-data-tags. - Carsten On Oct 22, 2010, at 1:20 PM, Sebastian Rose wrote: Carsten Dominik carsten.domi...@gmail.com writes: | l | l | r | | A | B | C | | 1 | 2 | 3 | | 12 | 13 | 300 | | 9 | 11 | 4 | I have now fixed this issue, at least for the HTML exporter. 1. The HTML exporter now puts a style attribute onto each individual field to make sure the field is aligned correctly. Many Browsers need this, as pointed out by Sebastian. If you do not like this overhead, you can configure org-export-html-table-align-individual-fields. If you do, the alignment will still be noted in the column tags, handled correctly by Opera, but not by Firefox and Safari. 2. The HTML exporter will also honor a c cookie. Note that this will not change anything inside an Org buffer - this would be complex to implement because of all the extra magic Org does with limited column width etc etc. 3. The LaTeX exporter does not yet honor c, while it does honor l and r. The reason for this is that currently the vector remembering the alignment is a vector of booleans, and larger changes are necessary in order to allow for a third value. This will come, but I do not have the time today. Hi Carsten, | | A | B|C | |---+-+--+--| | | 1 | bar | text | | | 12 | test | 300 | | | 9 | foo |4 | | / | ||| now gives me: table border=0 cellspacing=0 cellpadding=6 rules=groups frame=hsides caption/caption colgroupcol align=right //colgroup colgroupcol align=left //colgroup colgroupcol align=left //colgroup thead and I have no style attributes in the td tags. Sebastian - Carsten ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Carsten Dominik carsten.domi...@gmail.com writes: Hi Sebastian, my guess would be that you have customized the td and th tags? If yes, please reset the customization, you need the new default values (which you then can still modify). Please check the variables org-export-table-header-tags and org-export-table-data-tags. I've checked them, but they are not customized: Hide Org Export Table Data Tags: Opening tag: td%s Closing tag: /td State : STANDARD. Hide Org Export Table Header Tags: Opening tag: th scope=%s Closing tag: /th State : STANDARD. The export of the OPs table works as expected. But the table I've sent is different in that it just uses empty `' marks for grouping and creating lines. Sebastian | | A | B|C | |---+-+--+--| | | 1 | bar | text | | | 12 | test | 300 | | | 9 | foo |4 | | / | ||| now gives me: table border=0 cellspacing=0 cellpadding=6 rules=groups frame=hsides caption/caption colgroupcol align=right //colgroup colgroupcol align=left //colgroup colgroupcol align=left //colgroup thead and I have no style attributes in the td tags. ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Carsten Dominik carsten.domi...@gmail.com writes: On Oct 22, 2010, at 3:59 PM, Sebastian Rose wrote: Carsten Dominik carsten.domi...@gmail.com writes: Hi Sebastian, my guess would be that you have customized the td and th tags? If yes, please reset the customization, you need the new default values (which you then can still modify). Please check the variables org-export-table-header-tags and org-export-table-data-tags. I've checked them, but they are not customized: Hide Org Export Table Data Tags: Opening tag: td%s Closing tag: /td State : STANDARD. This does look right. Hide Org Export Table Header Tags: Opening tag: th scope=%s Closing tag: /th State : STANDARD. This does not look right, it should be Opening tag: th scope=%s%s Closing tag: /th The export of the OPs table works as expected. But the table I've sent is different in that it just uses empty `' marks for grouping and creating lines. While I do not think it is particularly nice that you try to fool the parser in this way :-/ it actually behaves quite well :-D Here is what I get when I export this table: --- table border=2 cellspacing=0 cellpadding=6 rules=groups frame=hsides caption/caption colgroupcol align=right //colgroupcolgroupcol align=left / /colgroupcolgroupcol align=left //colgroup thead trth scope=col style=text-align:rightA/thth scope=col style=text-align:leftB/thth scope=col style=text- align:leftC/th/tr /thead tbody trtd style=text-align:right1/tdtd style=text- align:leftbar/tdtd style=text-align:lefttext/td/tr trtd style=text-align:right12/tdtd style=text- align:lefttest/tdtd style=text-align:left300/td/tr trtd style=text-align:right9/tdtd style=text- align:leftfoo/tdtd style=text-align:left4/td/tr /tbody /table --- The left/right comes from the analysis of the number of numbers in each column... So I must assume that maybe some of your files did not update correctly or you have some old compiled files... ? OK, found it. It was in my .emacs which I didn't use for ages... But: colgroupcol align=right //colgroupcolgroupcol align=left //colgroupcolgroupcol align=left //colgroup must be: colgroupcol align=right /col align=left /col align=left //colgroup i.e. colgroup and /colgroup have to occur only once each and wrap the col ... / definitions. The /colgroup after each col ... / happens only for the second table. The rest is just fine :) Correct: | | A | B|C | |---+-+--+--| | | 1 | bar | text | | | 12 | test | 300 | | | 9 | foo |4 | | / | l | l | r | Wrong: | | A | B| C| |---++--+--| | | 1 | bar | text | | | 12 | test | 300 | | | 9 | foo | 4| | / | ||| Thanks for the fix! 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Carsten Dominik carsten.domi...@gmail.com writes: On Oct 22, 2010, at 3:59 PM, Sebastian Rose wrote: Carsten Dominik carsten.domi...@gmail.com writes: Hi Sebastian, my guess would be that you have customized the td and th tags? If yes, please reset the customization, you need the new default values (which you then can still modify). Please check the variables org-export-table-header-tags and org-export-table-data-tags. I've checked them, but they are not customized: Hide Org Export Table Data Tags: Opening tag: td%s Closing tag: /td State : STANDARD. This does look right. Hide Org Export Table Header Tags: Opening tag: th scope=%s Closing tag: /th State : STANDARD. This does not look right, it should be Opening tag: th scope=%s%s Closing tag: /th The export of the OPs table works as expected. But the table I've sent is different in that it just uses empty `' marks for grouping and creating lines. While I do not think it is particularly nice that you try to fool the parser in this way :-/ it actually behaves quite well :-D Here is what I get when I export this table: --- table border=2 cellspacing=0 cellpadding=6 rules=groups frame=hsides caption/caption colgroupcol align=right //colgroupcolgroupcol align=left / /colgroupcolgroupcol align=left //colgroup thead trth scope=col style=text-align:rightA/thth scope=col style=text-align:leftB/thth scope=col style=text- align:leftC/th/tr /thead tbody trtd style=text-align:right1/tdtd style=text- align:leftbar/tdtd style=text-align:lefttext/td/tr trtd style=text-align:right12/tdtd style=text- align:lefttest/tdtd style=text-align:left300/td/tr trtd style=text-align:right9/tdtd style=text- align:leftfoo/tdtd style=text-align:left4/td/tr /tbody /table --- The left/right comes from the analysis of the number of numbers in each column... So I must assume that maybe some of your files did not update correctly or you have some old compiled files... ? - Carsten Hi Carsten, one more, sorry. How about this (line-wrapped for readability): tr td class=right1/td td class=leftbar/td td class=lefttext/td tr instead of tr td style=text-align:right1/td td style=text-align:leftbar/td td style=text-align:lefttext/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; } since most of the time I want fixed width fonts in right aligned cells. 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
On Oct 22, 2010, at 9:30 PM, Sebastian Rose wrote: Carsten Dominik carsten.domi...@gmail.com writes: On Oct 22, 2010, at 3:59 PM, Sebastian Rose wrote: Carsten Dominik carsten.domi...@gmail.com writes: Hi Sebastian, my guess would be that you have customized the td and th tags? If yes, please reset the customization, you need the new default values (which you then can still modify). Please check the variables org-export-table-header-tags and org-export-table-data-tags. I've checked them, but they are not customized: Hide Org Export Table Data Tags: Opening tag: td%s Closing tag: /td State : STANDARD. This does look right. Hide Org Export Table Header Tags: Opening tag: th scope=%s Closing tag: /th State : STANDARD. This does not look right, it should be Opening tag: th scope=%s%s Closing tag: /th The export of the OPs table works as expected. But the table I've sent is different in that it just uses empty `' marks for grouping and creating lines. While I do not think it is particularly nice that you try to fool the parser in this way :-/ it actually behaves quite well :-D Here is what I get when I export this table: --- table border=2 cellspacing=0 cellpadding=6 rules=groups frame=hsides caption/caption colgroupcol align=right //colgroupcolgroupcol align=left / /colgroupcolgroupcol align=left //colgroup thead trth scope=col style=text-align:rightA/thth scope=col style=text-align:leftB/thth scope=col style=text- align:leftC/th/tr /thead tbody trtd style=text-align:right1/tdtd style=text- align:leftbar/tdtd style=text-align:lefttext/td/tr trtd style=text-align:right12/tdtd style=text- align:lefttest/tdtd style=text-align:left300/td/tr trtd style=text-align:right9/tdtd style=text- align:leftfoo/tdtd style=text-align:left4/td/tr /tbody /table --- The left/right comes from the analysis of the number of numbers in each column... So I must assume that maybe some of your files did not update correctly or you have some old compiled files... ? OK, found it. It was in my .emacs which I didn't use for ages... But: colgroupcol align=right //colgroupcolgroupcol align=left //colgroupcolgroupcol align=left //colgroup must be: colgroupcol align=right /col align=left /col align=left //colgroup i.e. colgroup and /colgroup have to occur only once each and wrap the col ... / definitions. The /colgroup after each col ... / happens only for the second table. Hi Sebastian, Are you sure about this? Because the is special syntax for Org to define column groups, and I believe it is OK to have multiple column groups in a table. - Carsten Correct: | | A | B|C | |---+-+--+--| | | 1 | bar | text | | | 12 | test | 300 | | | 9 | foo |4 | | / | l | l | r | Wrong: | | A | B| C| |---++--+--| | | 1 | bar | text | | | 12 | test | 300 | | | 9 | foo | 4| | / | ||| Thanks for the fix! 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
On Oct 22, 2010, at 9:37 PM, Sebastian Rose wrote: Carsten Dominik carsten.domi...@gmail.com writes: On Oct 22, 2010, at 3:59 PM, Sebastian Rose wrote: Carsten Dominik carsten.domi...@gmail.com writes: Hi Sebastian, my guess would be that you have customized the td and th tags? If yes, please reset the customization, you need the new default values (which you then can still modify). Please check the variables org-export-table-header-tags and org-export-table-data-tags. I've checked them, but they are not customized: Hide Org Export Table Data Tags: Opening tag: td%s Closing tag: /td State : STANDARD. This does look right. Hide Org Export Table Header Tags: Opening tag: th scope=%s Closing tag: /th State : STANDARD. This does not look right, it should be Opening tag: th scope=%s%s Closing tag: /th The export of the OPs table works as expected. But the table I've sent is different in that it just uses empty `' marks for grouping and creating lines. While I do not think it is particularly nice that you try to fool the parser in this way :-/ it actually behaves quite well :-D Here is what I get when I export this table: --- table border=2 cellspacing=0 cellpadding=6 rules=groups frame=hsides caption/caption colgroupcol align=right //colgroupcolgroupcol align=left / /colgroupcolgroupcol align=left //colgroup thead trth scope=col style=text-align:rightA/thth scope=col style=text-align:leftB/thth scope=col style=text- align:leftC/th/tr /thead tbody trtd style=text-align:right1/tdtd style=text- align:leftbar/tdtd style=text-align:lefttext/td/tr trtd style=text-align:right12/tdtd style=text- align:lefttest/tdtd style=text-align:left300/td/tr trtd style=text-align:right9/tdtd style=text- align:leftfoo/tdtd style=text-align:left4/td/tr /tbody /table --- The left/right comes from the analysis of the number of numbers in each column... So I must assume that maybe some of your files did not update correctly or you have some old compiled files... ? - Carsten Hi Carsten, one more, sorry. How about this (line-wrapped for readability): tr td class=right1/td td class=leftbar/td td class=lefttext/td tr instead of tr td style=text-align:right1/td td style=text-align:leftbar/td td style=text-align:lefttext/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; } OK, fair enough. But I don't think I will make the monospace the Org default, it looks a bit odd. BUt of cause you can change this. 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 ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
On 10/21/10 2:25 AM, Sebastian Rose wrote: (...) |l |l |r | | A | B | C | | 1 | 2 | 3 | | 12 | 13 | 300 | | 9 | 11 | 4 | I get colgroupcol align=left /col align=left /col align=right / /colgroup as expected. That's interesting. From the same example I get colgroupcol align=right /col align=right /col align=right //colgroup ...using freshly pulled 7.01trans. What might account for the difference? In Opera it works for me, if I remove the styles for `td' from my stylesheet. The styles for table data cells will overrule the align attribute in the col tag. Current Firefox seems to ignore the align attribute, although it's valid XHTML. Good for Opera! I think Firefox generally ignores colgroup styling. Doesn't work on Safari, either. CM ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
On Oct 21, 2010, at 9:36 AM, Christian Moe wrote: On 10/21/10 2:25 AM, Sebastian Rose wrote: (...) |l |l |r | | A | B | C | | 1 | 2 | 3 | | 12 | 13 | 300 | | 9 | 11 | 4 | I get colgroupcol align=left /col align=left /col align=right / /colgroup as expected. That's interesting. From the same example I get colgroupcol align=right /col align=right /col align=right //colgroup ...using freshly pulled 7.01trans. What might account for the difference? Actually, I also get what Christian gets. Sebastian, how did you get something different? Currently alignment is only by the fraction of number in the column, not by the l and r markers. Should be of cause... - Carsten ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Carsten Dominik carsten.domi...@gmail.com writes: On Oct 21, 2010, at 9:36 AM, Christian Moe wrote: On 10/21/10 2:25 AM, Sebastian Rose wrote: (...) |l |l |r | | A | B | C | | 1 | 2 | 3 | | 12 | 13 | 300 | | 9 | 11 | 4 | I get colgroupcol align=left /col align=left /col align=right / /colgroup as expected. That's interesting. From the same example I get colgroupcol align=right /col align=right /col align=right //colgroup ...using freshly pulled 7.01trans. What might account for the difference? Actually, I also get what Christian gets. Sebastian, how did you get something different? I guess I just didn't pull for a few days. Nononono, just kidding :) I tried my own table, which is different: a) The l line is the last one. b) There's an empty extra column, the first one, as the docs propose. This column contains in the first cell of the l | r line a slash: | | A | B | C | | | 1 | 2 | 3 | | | 12 | 13 | 300 | | | 9 | 11 | 4 | | / | l | l | r | All this does not help. But the third difference might be the key: c) The table is a captured column view (#+BEGIN: columnview...) with 293 lines. 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Sebastian Rose sebastian_r...@gmx.de writes: Carsten Dominik carsten.domi...@gmail.com writes: On Oct 21, 2010, at 9:36 AM, Christian Moe wrote: On 10/21/10 2:25 AM, Sebastian Rose wrote: (...) |l |l |r | | A | B | C | | 1 | 2 | 3 | | 12 | 13 | 300 | | 9 | 11 | 4 | I get colgroupcol align=left /col align=left /col align=right / /colgroup as expected. That's interesting. From the same example I get colgroupcol align=right /col align=right /col align=right //colgroup ...using freshly pulled 7.01trans. What might account for the difference? Actually, I also get what Christian gets. Sebastian, how did you get something different? I guess I just didn't pull for a few days. Nononono, just kidding :) I tried my own table, which is different: a) The l line is the last one. b) There's an empty extra column, the first one, as the docs propose. This column contains in the first cell of the l | r line a slash: | | A | B | C | | | 1 | 2 | 3 | | | 12 | 13 | 300 | | | 9 | 11 | 4 | | / | l | l | r | All this does not help. But the third difference might be the key: c) The table is a captured column view (#+BEGIN: columnview...) with 293 lines. Well, OK, forget it... It was just that my ls and rs matched with the sensible thing to do for each column. Seems it's just looking at the numbers and says OK, numbers only, right aligned, just as you said in a previous mail. | | A | B| C | |---+-+--+--| | | 1 | bar | text | | | 12 | test | 300 | | | 9 | foo |4 | | / | l | l | r | gives us colgroupcol align=right /col align=left /col align=left / /colgroup 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
[Orgmode] Re: Aligning Columns in HTML Export Tables
Jeff Horn jrhorn...@gmail.com writes: Is there a way to specify a particular column in org-mode that will be exported right-aligned in HTML? | A | B | C | | 1 | 2 | 3 | For the table above, I would like column C right aligned when I export to HTML, but the other column aligned in the default way (left aligned?). I think this is supposed to work but it seems the exporters do not honour the alignment details. | l | l | r | | A | B | C | | 1 | 2 | 3 | | 12 | 13 | 300 | | 9 | 11 | 4 | Regards, Bernt ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
On 10/20/10 7:16 PM, Bernt Hansen wrote: Jeff Hornjrhorn...@gmail.com writes: Is there a way to specify a particular column in org-mode that will be exported right-aligned in HTML? | A | B | C | | 1 | 2 | 3 | For the table above, I would like column C right aligned when I export to HTML, but the other column aligned in the default way (left aligned?). I think this is supposed to work but it seems the exporters do not honour the alignment details. |l |l |r | | A | B | C | | 1 | 2 | 3 | | 12 | 13 | 300 | | 9 | 11 | 4 | That's what I find. Ironically, the HTML exporter even includes a =colgroup= with a local =align= attribute set on each =col=, but they all get set to ~align=right~ despite the settings in the table. Not that it matters; e.g. Firefox doesn't honor colgroup formatting anyway. As a CSS workaround for this particular example, you could add this to the header lines: : #+style: styletr td + td + td {text-align: right;}/style -- but it would clearly be nicer if the exporter honored the settings. Yours, CM ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
On Wed, Oct 20, 2010 at 3:04 PM, Christian Moe m...@christianmoe.com wrote: #+style: styletr td + td + td {text-align: right;}/style Thanks Christian, this workaround is OK for me at the moment since I'm just making this change in one file. +1 (naturally) for the exporter honoring column alignment settings. -- Jeffrey Horn Graduate Lecturer and PhD Student in Economics George Mason University (704) 271-4797 jh...@gmu.edu jrhorn...@gmail.com http://www.failuretorefrain.com/jeff/ ___ 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
Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Bernt Hansen be...@norang.ca writes: Jeff Horn jrhorn...@gmail.com writes: Is there a way to specify a particular column in org-mode that will be exported right-aligned in HTML? | A | B | C | | 1 | 2 | 3 | For the table above, I would like column C right aligned when I export to HTML, but the other column aligned in the default way (left aligned?). I think this is supposed to work but it seems the exporters do not honour the alignment details. | l | l | r | | A | B | C | | 1 | 2 | 3 | | 12 | 13 | 300 | | 9 | 11 | 4 | I get colgroupcol align=left /col align=left /col align=right / /colgroup as expected. In Opera it works for me, if I remove the styles for `td' from my stylesheet. The styles for table data cells will overrule the align attribute in the col tag. Current Firefox seems to ignore the align attribute, although it's valid XHTML. The only save way to get the alignment right would be to use a style attribute for each and every table cell directly: td style=text-align:right 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