LIONEL BARTH wrote:
>
> I am trying to use the new value-editor feature for generated content in a
> table :
>
> Hotel:after { content: attributes(); }Hotel:attribute("Price") {
> attribute-content-middle: cell(content(value-editor(attribute, "Price"),
> width, 50px)); show-attribute: always; }
> It works but the width property has no effect. It does not disturb, it just
> has no effect.
The width CSS property is only used to specify the width of a cell in a
table, otherwise it is ignored. And attributes() does not create a
table. (I'll document this in the Power User's Guide.)
What you want to do can be achieved by using text-field() or even better
number-field() rather than value-editor(). These fields support the
columns parameter to specify their widths.
Here's the simplest and most efficient way to do what you want:
Hotel:after {
display: block;
content: number-field(attribute, "Price",
data-type, float, /*fix this type if needed
to*/
columns, 5);
/*add margins if needed to*/
}
Note that attributes() is not needed, nor the Hotel:attribute("Price")
CSS rule.