Module:Infobox chord: Difference between revisions

Don't hardcode values
CSS +1
Line 197: Line 197:
table.insert(infobox_data, {"Subharmonics", "1/(" .. table.concat(subharmonics, ":") .. ")"})
table.insert(infobox_data, {"Subharmonics", "1/(" .. table.concat(subharmonics, ":") .. ")"})
end
end
table.insert(infobox_data, {"Intervals from root",  
table.insert(infobox_data, {"Intervals from root", table.concat(root_interval_links,  
table.concat(root_interval_links, "<span style=\"padding-left: 0.1em; padding-right: 0.1em; white-space: nowrap;\">&ndash;</span>")})
"<span style=\"padding-left: 0.1em; padding-right: 0.1em; white-space: nowrap;\">&ndash;</span>")})
table.insert(infobox_data, {"Cents from root",  
table.insert(infobox_data, {"Cents from root", table.concat(root_cents_steps,  
table.concat(root_cents_steps, "<span style=\"padding-left: 0.1em; padding-right: 0.1em; white-space: nowrap;\">&ndash;</span>")})
"<span style=\"padding-left: 0.1em; padding-right: 0.1em; white-space: nowrap;\">&ndash;</span>")})
table.insert(infobox_data, {"Step intervals", table.concat(step_interval_links, ", ")})
table.insert(infobox_data, {"Step intervals", table.concat(step_interval_links, ", ")})
table.insert(infobox_data, {"Step cents", table.concat(step_cents, ", ")})
table.insert(infobox_data, {"Step cents", table.concat(step_cents, ", ")})
Line 222: Line 222:
end
end


local genus_data = table.concat(genus_terms, "&#x200A;&sdot;&#x200A;")
local genus_data = table.concat(genus_terms,  
"<span style=\"padding-left: 0.1em; padding-right: 0.1em; white-space: nowrap;\">&sdot;</span>")
-- append the actual product if it's (arbitrarily) 9 digits or fewer
-- append the actual product if it's (arbitrarily) 9 digits or fewer
if genus_product < 1000000000 then
if genus_product < 1000000000 then