Add css classes to specific dataview tables

I’m looking for a way to add css classes to content containing some dataview tables.

I tried putting my dataviewjs block inbetween html tags but it just ends up rendering the script.

What I have

A little <Promise> shows up.

        let abilities = dv.array(dv.current().abilities.map(link => dv.page(link.path)));
        dv.el(
            "div", 
            dv.table(
                ["Ability", "Description", "Cast"],
                abilities
                .sort(p => p.file.name)
                .map(p => [
                    p.file.link, 
                    "llol", 
                    this.create_button(dv, "cast", this.spell_button_func, {msg: p.file.name})
                ])
            ),
            {cls: "my-class"}
        );

I’ve written a somewhat lengthy post on this topic in the thread below:

Hopefully it should target your needs, so try it out, and if there is something unclear show us how far you’ve gotten based on the post above, and we’ll look into a little further.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.