ATTENTION! The process of updating WiKi to version Eco 10.x has begun. Those wishing to participate can find out more Information on our ECO Contribution Wiki Discord.

Module:PlantsPreferences: Difference between revisions

From Eco - English Wiki
[checked revision][checked revision]
No edit summary
No edit summary
Line 19: Line 19:
header = header .. "<tr> \n "
header = header .. "<tr> \n "
header = header .. "<th></th> \n "
header = header .. "<th colspan=\"2\">Ideal</th> \n "
header = header .. "<th colspan=\"2\">Ideal</th> \n "
header = header .. "<th colspan=\"2\">Extreme</th> \n "
header = header .. "<th colspan=\"2\">Extreme</th> \n "
Line 29: Line 28:


header = header .. "<tr> \n "
header = header .. "<tr> \n "
header = header .. "<th></th> \n "
header = header .. "<th>Min</th> \n "
header = header .. "<th>Min</th> \n "
header = header .. "<th>Max</th> \n "
header = header .. "<th>Max</th> \n "
Line 46: Line 44:
wiki = header
wiki = header


for p,a in pairs(plants) do
local row = ''
row = row .. "<tr> \n "
row = row .. "</tr>"
wiki = wiki .. row
end


wiki = wiki .. " </table>"
wiki = wiki .. " </table>"

Revision as of 19:57, 18 February 2022

Documentation

This module provides the back end functionality of the Template:PlantsPreferences.

If the template is passed, this module creates a list using details from the following Modules:


local p = {}

function p.main()
	local wiki = ''

	-- import the required modules
	local PlantData = require( "Module:PlantData" )	
	
	local plants = PlantData.plants

	-- create the header of the table
	local header = "<table class=\"wikitable sortable\"> \n " 
	header = header .. "<tr> \n "
	header = header .. "<th rowspan=\"3\">Plant</th> \n "
	header = header .. "<th colspan=\"4\">Temperature<br>Ranges</th> \n "
	header = header .. "<th colspan=\"4\">Moisture<br>Ranges</th> \n "
	header = header .. "<th colspan=\"4\">Salt<br>Ranges</th> \n "
	header = header .. "</tr> \n "
	
	header = header .. "<tr> \n "
	header = header .. "<th colspan=\"2\">Ideal</th> \n "
	header = header .. "<th colspan=\"2\">Extreme</th> \n "
	header = header .. "<th colspan=\"2\">Ideal</th> \n "
	header = header .. "<th colspan=\"2\">Extreme</th> \n "
	header = header .. "<th colspan=\"2\">Ideal</th> \n "
	header = header .. "<th colspan=\"2\">Extreme</th> \n "
	header = header .. "</tr> \n "

	header = header .. "<tr> \n "
	header = header .. "<th>Min</th> \n "
	header = header .. "<th>Max</th> \n "
	header = header .. "<th>Min</th> \n "
	header = header .. "<th>Max</th> \n "
	header = header .. "<th>Min</th> \n "
	header = header .. "<th>Max</th> \n "
	header = header .. "<th>Min</th> \n "
	header = header .. "<th>Max</th> \n "
	header = header .. "<th>Min</th> \n "
	header = header .. "<th>Max</th> \n "
	header = header .. "<th>Min</th> \n "
	header = header .. "<th>Max</th> \n "
	header = header .. "</tr> \n "

	wiki = header

	for p,a in pairs(plants) do
		local row = ''
		row = row .. "<tr> \n "


		row = row .. "</tr>"
	wiki = wiki .. row
	end

	wiki = wiki .. " </table>"
	return wiki
	end
return p