Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^3: CSV or HTML? (now OT)

by ww (Archbishop)
on Jan 19, 2012 at 12:36 UTC ( #948772=note: print w/replies, xml ) Need Help??

in reply to Re^2: CSV or HTML?
in thread CSV or HTML?

...and the name of "a standards compliant browser" (to which to your refer) is?

I ask because I don't really believe there is such a thing.

Tangent: Using the phrase "standards compliant" (yeah, I'm guilty too) tends to obscure the issue -- IMO -- which arises from the fact that "standards compliant" is not the same as "implements all of whichever relevant standard one might select."

There is, for example, a "standard" (and right now I've forgotten whether its CSS or html4.1) providing a way to align a mixed length set of decimal numbers*1 in a column of <td>s in a <table> (it applies to other things too, but that's easy to grasp.

That would be a very handy standard to follow... except that no browser (of which I'm aware) actually implements it. Yes, there are workarounds, but as is often the case, those workarounds are often a PITA.

*1 Example of the mixed length set of:


One common workaround, aligning the column rightward, doesn't work there, but some means of aligning the decimal points sure would make it easier to read.

Replies are listed 'Best First'.
Re^4: CSV or HTML? (now OT)
by Tux (Abbot) on Jan 19, 2012 at 13:00 UTC
    ...and the name of "a standards compliant browser" (to which to your refer) is?

    I ask because I don't really believe there is such a thing.

    There is only one reference browser: amaya. But you'd be a serious masochist if you actually use it :).

    I'm curious what that mixed alignment setting would be: I cannot find it in my CSS3 reference.

    Enjoy, Have FUN! H.Merijn

      Tux: Not the canonical reference but in there is this:

      Hint: You can achieve a similar effect to the above by using decimal alignment and using the DP attribute to set the alignment character to a convenient character, for example:
      <table> <tr align=decimal dp=":"> <td> name: <input name="name" size=18><br> card number: <input name="cardnum" size=18><br> expires: <input name="expires-month" size=2> / <input name="expires-year" size=2><br> telephone:<input name="phone" size=18><br> </table>
      Each line in the table is then indented so that all the colons are positioned under one another.

      And yes, Amaya is a reference browser, but that doesn't change it's incompleteness (acknowledged with respect to CSS, for example, at at the heading "Support for CSS").

      BTW, I have used it and while it sure is painful to do so, I'm not sure I'd characterize myself as a masochist. Excuse me now, while I go back to reading some nearly unintelligible nodes. :-)

Re^4: CSV or HTML? (now OT)
by tobyink (Abbot) on Jan 19, 2012 at 21:14 UTC

    ...and the name of "a standards compliant browser" (to which to your refer) is?

    For the purpose of my example, any version of Opera, Mozilla or Safari released in the last decade should do, as should IE9.

    Sure there are plenty of holes in standards compliance in browsers, but this particular standard (parsing XHTML) is pretty reliably implemented.

      "Re^2: CSV or HTML?
      by tobyink on Jan 19, 2012...
      .... (Illustration & other narrative, omitted. ....
      The above, viewed in a standards compliant browser, in XHTML mode, will show a green paragraph. The CSS which sets it to red is commented out and ignored.

      and, in the parent of this node

      For the purpose of my example, any version of Opera, Mozilla or Safari released in the last decade should do, as should IE9.

      Did you intend to exclude FF from your list because it doesn't satisfy your standards for "standards compliant" or simply because three examples, with a fourth as an afterthought, seemed adequate to lead the reader to infer that you mean any widely distributed browser, Y2k or a bit more recent, will fill the bill?

      If so, then once again I seem to be missing something.

      Using your "Illustration" xhtml, verbatim, in a file called "xhtml_test.xhtml", serving it from Xitami on a win32 box, and browsing it in what FF 9.01 claims is "Standards Compliant Mode," I see the supposedly green para in red.

      Adding <meta http-equiv="Content-Type: application/xhtml+xml"> immediately after the dtd does NOT change the rendering.

      Want to take another shot at pointing me in the right direction?
          (I hope.)

        I included "Mozilla" in my list, and intended for that to cover Firefox and any other browser derived from the Mozilla codebase. Certainly any version of Firefox will do - even versions from back when it was called "Phoenix".

        Check your HTTP headers:

        perl -MLWP::UserAgent -e'print LWP::UserAgent->new->get("http://localh +ost/xhtml_test.xhtml")->headers->as_string'

        I'm guessing you'll see Content-Type: text/html. As I said, my example is XHTML, and assumes that the page is served with the correct XHTML media type Content-Type: application/xhtml+xml. Adding a <meta> tag to the document will not make any difference.

Re^4: CSV or HTML? (now OT)
by MidLifeXis (Monsignor) on Jan 20, 2012 at 13:46 UTC

    I believe that something along these lines would have worked at one time...

    <style> .mlx-test-align tr td { text-align: "."; } </style> <table class="mlx-test-align"> <tr><td>1.01234</td></tr> <tr><td>101.234</td></tr> <tr><td>101.00</td></tr> <tr><td>10123.4</td></tr> </table>
    ... but according to the blooberry CSS reference (IME, a fairly reliable summary of the various aspects of the CSS and HTML specs),
    The [string] value type has been removed in CSS2.1.
    I was not able to produce the correct alignment using text-align, but that may speak more of my capabilities than the capabilities of my browsers.

    Rather a shame, as aligning to a character has some useful applications.

    Update: It appears that another blooberry page has some possibly updated information (testing below...)

    Example from
    Vegetable Cost per kilo
    Lettuce $1
    Silver carrots $10.50
    Golden turnips $100.30

    I am not able to reproduce their results. My guess is that I didn't set the document type correctly.


      There's a statement on, a w3cschools page with a 2012 copyright (though that may be a mere boiler-plate footer) that "The char attribute is not supported by any of the major browsers."

      My guess is that has more to do with reproducing their results than your doctype setting. When I have a bit more free time, I should probably grab a current version of Amaya and see how it fares (or, perhaps, some other 'masochist'-- see Tux's above -- would like to report some findings).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://948772]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2018-07-21 06:15 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (444 votes). Check out past polls.