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: Sebastian Rose
Subject: Re: [Orgmode] Re: Aligning Columns in HTML Export Tables
Date: Fri, 22 Oct 2010 21:30:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Carsten Dominik <address@hidden> writes:
> On Oct 22, 2010, at 3:59 PM, Sebastian Rose wrote:
>
>> Carsten Dominik <address@hidden> 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>
> <colgroup><col align="right" /></colgroup><colgroup><col align="left" /
>></colgroup><colgroup><col align="left" /></colgroup>
> <thead>
> <tr><th scope="col" style="text-align:right">A</th><th scope="col"
> style="text-align:left">B</th><th scope="col" style="text- 
> align:left">C</th></tr>
> </thead>
> <tbody>
> <tr><td style="text-align:right">1</td><td style="text-
> align:left">bar</td><td style="text-align:left">text</td></tr>
> <tr><td style="text-align:right">12</td><td style="text-
> align:left">test</td><td style="text-align:left">300</td></tr>
> <tr><td style="text-align:right">9</td><td style="text-
> align:left">foo</td><td style="text-align:left">4</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:

  <colgroup><col align="right" /></colgroup><colgroup><col align="left" 
/></colgroup><colgroup><col align="left" /></colgroup>

must be:

  <colgroup><col 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



reply via email to

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