explorable-viz / fluid

Data-linked visualisations
http://f.luid.org
MIT License
32 stars 1 forks source link

`TableView`: decimal alignment #1009

Open rolyp opened 2 weeks ago

rolyp commented 2 weeks ago

This should (apparently) be supported by setting align="char" and char="." on a td, but it doesn’t seem to be supported by many (or any) browsers.

One solution might be to use two table columns, one for the integral part and one for the period/mantissa.

Update: No, that would break selectability. Here’s a pure CSS/HTML solution that might be worth trying:

<div>
    <span class="int">11.</span><span class="float">293</span>
</div>
<div>
    <span class="int">233424.</span><span class="float">89</span>
</div>
.int, .float{
    display: inline-block;
    width: 100px;
}
.int{
    text-align: right;
}
.float{
    text-align: left;
}