-- Converts Lua table to HTML output in table.html file function tohtml(x) ret = tohtml_table(x,1) writefile("table.html", ret) os.execute("table.html") return(ret) end -- Saves a string to file function writefile(filename, value) if (value) then local file = io.open(filename,"w+") file:write(value) file:close() end end function tohtml_table(x, table_level) local k, s, tcolor local html_colors = { "#339900","#33CC00","#669900","#666600","#FF3300", "#FFCC00","#FFFF00","#CCFFCC","#CCCCFF","#CC66FF", "#339900","#33CC00","#669900","#666600","#FF3300", "#FFCC00","#FFFF00","#CCFFCC","#CCCCFF","#CC66FF" } local lineout = {} local tablefound = false if type(x) == "table" then s = "" k = 1 local i, v = next(x) while i do if (type(v) == "table") then if (table_level<10) then lineout[k] = "" .. flat(i) .. "".. tohtml_table(v, table_level + 1) else lineout[k] = "MAXIMUM LEVEL BREACHED" end tablefound = true else lineout[k] = flat(i) .. "=" .. tohtml_table(v) end k = k + 1 i, v = next(x, i) end for k,line in ipairs(lineout) do if (tablefound) then s = s .. "