Rendering a Dataview table in an HTML element

I’ve been trying to render a dataview table in one of my HTML based sidebar things and I am having trouble figuring out a good way to do it, I’ve tried various methods and the closest I’ve got is the following snippet

dv.container = document.getElementById("dataview");
dv.execute("TABLE TimeComplexity FROM #Non_Mutating_Algorithms");

It however appears very janky often times duplicating itself, not rendering, lagging randomly, etc. The main issue however is that it wont even render when I am in reading mode

This is how it looks in Edit mode

This is how it looks in Reading mode

I’ve recently changed the code to the following and the error still persists any help would be apperciated as I would like to get this working

dv.container = document.getElementById("methods");
dv.table(["Method", "Time Complexity", "Version"], dv.pages("#Unordered_Set_Method").map(b => [b.file.link, b.TimeComplexity, b.Version]));