- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Wed, 21 Jan 2009 13:07:01 -0600
- To: Boris Zbarsky <bzbarsky@mit.edu>
- Cc: Giovanni Campagna <scampa.giovanni@gmail.com>, www-style@w3.org
On Wed, Jan 21, 2009 at 12:36 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote: > > Giovanni Campagna wrote: >> >> How would you do that? If you display the ::before with inline-block, it >> will not float (only block can float), neither it will text-align unless you >> manually widen the inline-block box (but it will align left of the widened >> block, not left of the table-cell). >> >> (The use case is the same as the first post, aligning generated content to >> the start edge of a table-cell, while putting the dom content aligned on the >> right, like in Microsoft Excel "Contability" formatting) > > Ok, I seem to really be missing something. Let's step back for a second. > Forget generated content. Let's say you can edit the HTML to produce the > effect you want. What would the original HTML+CSS (before the effect has > been produced) look like? What would the final HTML+CSS (with the effect > produced) look like? Let's start with the use-case. Giovanni wants to be able to line things up like this: +-------+ |$ 5.00| +-------+ |$ 25.00| +-------+ |$100.00| +-------+ |$ 25.5 | +-------+ So that the content is aligned both on the "$" and the ".". Currently, the only way to do this is by splitting this into two table cells: <table><tbody> <tr><td>$</td><td>5.00</td></tr> <tr><td>$</td><td>25.00</td></tr> <tr><td>$</td><td>100.00</td></tr> <tr><td>$</td><td>25.5</td></tr> </tbody></table> <style> td { text-align: "."; } </style> This is pretty darned unsemantic, though. ~TJ
Received on Wednesday, 21 January 2009 19:07:36 UTC