Module:Sandbox/Vestrian24Bio/JSON table explained

local cjson = require "cjson"

-- Function to convert JSON table to HTML tablelocal function jsonToHtmlTable(jsonStr) local jsonTable = cjson.decode(jsonStr) local html = "

" .. tostring(key) .. "\n" html = html .. "
\n" html = html .. "\n" else html = html .. "" .. tostring(value) .. "\n" end html = html .. "\n" end end

generateRows(jsonTable) html = html .. "\n" return htmlend

-- Example JSON stringlocal jsonStr =

-- Convert JSON to HTML tablelocal htmlTable = jsonToHtmlTable(jsonStr)print(htmlTable)