Scrollable Dataview tables for Specific notes

What I’m trying to do

I want to create a scrollable Dataview Tables for **specific notes only**

Things I have tried

I’m not a coder, but have successfully manipulated many dataviews with a little help from forums.
I have gone through the below linked forum posts, deployed the following code & it affects all notes. I only want it applied to some.

Thanks a bunch!

You could try this:

.dvScroll .block-language-dataview  {
    display: block;
    max-height: 400px;
    overflow: auto;
}

and put dvScroll in cssclasses of the notes you want to apply the snippet to. dvScroll can be pretty much anything as long as the class isn’t already taken by other CSS or the theme you are using.


https://help.obsidian.md/Editing+and+formatting/Properties#Default+properties

2 Likes

Thanks so much mate. I owe you a kidney

The caveat you mentioned, fortunately isn’t an issue. Multiple cssclasses can be taken. My requirement was for a homepage which already used a dashboard.css, & both of these snippets work together perfectly.

Further findings for those who need:
(Illustrated below) You can include code for multiple types of scroll tables in that one CSS file. So you can use a specific type for whichever note, by adding that type under [cssclasses]. Unspecified notes will default to the default dataview settings.

.dvScroll .block-language-dataview {
display: block;
max-height: 250px;
overflow: auto;
}
.dvScroll2 .block-language-dataview {
display: block;
max-height: 500px;
overflow: auto;
}

1 Like

Awesome!

For next time, putting your examples or code in a code block will make it easier for folks to read and copy. e.g.

.dvScroll .block-language-dataview {
display: block;
max-height: 250px;
overflow: auto;
}
.dvScroll2 .block-language-dataview {
display: block;
max-height: 500px;
overflow: auto;
}
1 Like

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