std.tbl.render

std.tbl

render(t, indent) -> output

Render a table as a formatted string

Produces a human-readable, indented representation of a table. Each key–value pair is placed on its own line; nested tables are indented by two spaces per level. Non-table values are formatted with tostring. If t is not a table, returns tostring(t).

Example output:

{
  name = "Alice",
  scores = {
    math = 95,
    art = 88,
  },
}