[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] MIME attachments for comint
From: |
Augusto Stoffel |
Subject: |
Re: [RFC] MIME attachments for comint |
Date: |
Tue, 28 Sep 2021 20:22:27 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
On Tue, 28 Sep 2021 at 11:29, Robin Tarsiger <rtt@dasyatidae.com> wrote:
> Augusto Stoffel wrote:
>> The following example
>> <table style="text-align: right">
>> <tr style="text-align: right"><td>A</td><td>1.0</td></tr>
>> <tr><td style="text-align: right">AA</td><td>10.0</td></tr>
>> <tr><td>AAA</td><td>100.0</td></tr>
>> </table>
>> renders like this:
>> A 1.0
>> AA 10.0
>> AAA 100.0
>> Is there any other syntax for text alignment in HTML?
>
> There's the pre-CSS align="right" property style. Also valign for
> vertical-align.
This also doesn't seem to work with shr.
> I notice that shr doesn't have anything close to a full CSS parser
> to start with, which is understandable given the complexity of such
> a thing. However, note that in a full document, it's also reasonable
> in an HTML context to do something like
>
> <style>
> table.foo td.bar { text-align: right }
> table.foo td.baz { text-align: center }
> </style>
> <!-- ... -->
> <table class="foo">
> <tr><td class="bar">A</td><td class="baz">III</td><td
> class="baz">XII</td></tr>
> <tr><td class="bar">B</td><td class="baz">XIV</td><td
> class="baz">VII</td></tr>
> </table>
>
> where the alignments cannot be inferred from a purely local
> traversal. I don't know how many people do this, but I do when
> I'm outputting HTML tables with known record formats, because
> it makes it much easier to restyle the types/columns as needed
> (that being the purpose of CSS in the first place).
>
> I'm curious what your likely HTML sources are going to be for this,
> since if you try to subset the above at all then what you need to
> support becomes very dependent on what the generators are like.
Yes, the most obvious use-case here would be a Pandas dataframe (or the
equivalent from any other statistical package). In the Pandas case, the
HTML looks pretty much like what you posted.
But the capability to right-align is a somewhat separate question from
the notation used to chose it. If shr could render table with right
alignment, one could at least do some ad-hoc stuff for the main cases.
> -RTT