Module:Data tables/common

From Kerbal Space Program 2 Wiki
Revision as of 17:04, 2 February 2025 by KiwiShark (talk | contribs) (add common headers)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Data tables/common/doc

local p = {}

function p.commonHeaders()
	return "{| class=\"wikitable sortable\" style=\"text-align: center\"\n" ..
		"!Image\n" ..
		"!Name\n" ..
		"!Size\n" ..
		"!Mass (t)\n" ..
		"!Max Temperature (K)\n" ..
		"!Impact Tolerance (m/s)\n"
end

function p.commonCells(partJson)
	local commonCells = "|-\n" ..
			"|".."[[File:"..partJson["file"].."|80px|center]]\n" ..
			"|".."[["..partJson["name"].."]]\n" ..
			"|".."{{Size|Size="..partJson["size"].."}}\n" ..
			"|"..partJson["mass"].."\n" ..
			"|"..partJson["max_temp"].."\n" ..
			"|"..partJson["imp_tol"].."\n"
	return commonCells
end

return p