DataviewJS READ from table (not write to table)

Pretty straightforward question. Sorry if this has been asked before. Is there a way to denote a table as an inline variable to dataview? I’ld like to take existing tables that a user has added to and use that as my data source to do some dataview operations on.

This is a small example of what i mean below. There is lots of information on how to write out tables and structure output of tables. Is there a way to do the opposite of reading in table data?

What I’m trying to do

# Daily Food
| Food  | Calories |
| ----- | -------- |
| eggs  | 300      |
| bread | 100   |

``dataviewjs
// how to select the table, get the row values, and then iterate through and sum up total calories in column 2 
``

1 Like

There is no simplistic way to read a markdown table like you want to.

It is possible to load the document, I think, in a parsed version and traverse the document object (and maybe this is even available directly from dataviewjs). But you need to do that traversal use your own b logic, so not for the faint of heart.

You could also read the markdown source, and parse that, but I believe that’s even hairier (if that’s a word).