You could pass in the table you want the values set on, like this:
function x(tbl)
tbl.Height = 20;
tbl.Width = 30;
end
local t={}
x(t)
print(t.Height, t.Width)
although it may make more sense to use nested tables depending on how complex the structure will be of whatever is in the table.
function x(tbl)
table.insert(tbl, {Height = 20, Width = 30})
end
local t={}
x(t)
print(t[1].Height, t[1].Width)
which would be equivalent to this:
function x()
return {Height = 20, Width = 30}
end
local t = {x()}
print(t[1].Height, t[1].Width)
So really, it depends on how you want to group the data and which syntax you prefer.