<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[Solved] Data layout - icon and text in same cell with spacing]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I’m nearly finished with my MMM-Hive module, but just have one issue that I cannot get my head around.</p>
<p dir="auto">With the current code, the layout looks like this:<br />
<img src="/assets/uploads/files/1501309000645-frost_protect1.png" alt="0_1501308995994_frost_protect1.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Notice the snowflake icon is right next to the Frost Protect Enabled text.</p>
<p dir="auto">I would like it to look like this (proper icon spacing next to the text and also in line with the icon above) :<br />
<img src="/assets/uploads/files/1501309045387-frost_protect2.png" alt="0_1501309041342_frost_protect2.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">This is the relevant code:</p>
<pre><code>		var targetTemperatureRow = document.createElement("tr");
		if (this.config.showNext == true) {
		var targetTemperatureCell = document.createElement("td");
		targetTemperatureCell.colSpan = 5;	
			if (this.insideTarget &gt;= 1) {
					targetTemperatureCell.innerHTML = "Frost Protect Enabled";
					targetTemperatureCell.className = "light dimmed xsmall";
					var frostCell = document.createElement("span");
					frostCell.setAttribute("aria-hidden","true");
					frostCell.className = "fa fa-snowflake-o";
					frostCell.style.cssText="color:white;";
					targetTemperatureCell.appendChild(frostCell);
					targetTemperatureRow.appendChild(targetTemperatureCell);
					}
			else {	
				targetTemperatureCell.innerHTML = this.config.targetTempText + " " + this.insideTarget + this.config.temperatureSuffix;
				targetTemperatureCell.className = "light xsmall";
				targetTemperatureRow.appendChild(targetTemperatureCell);
				}}

		table.appendChild(temperatureRow);
		table.appendChild(targetTemperatureRow);
</code></pre>
<p dir="auto">I was looking at using flexbox, but I’m loathe to spend another x amount of hours and just want to get this module finished now :)</p>
<p dir="auto">If anyone has any ideas on the above, it will be greatly appreciated, and might prevent me from pulling any more hair out!</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.magicmirror.builders/topic/4574/solved-data-layout-icon-and-text-in-same-cell-with-spacing</link><generator>RSS for Node</generator><lastBuildDate>Sat, 12 Sep 2026 04:20:19 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/4574.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 29 Jul 2017 06:23:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Solved] Data layout - icon and text in same cell with spacing on Sat, 29 Jul 2017 07:47:50 GMT]]></title><description><![CDATA[<p dir="auto">I’ve been ‘googling’ since posting and have found the solution (may not be the best solution, but it is now working).</p>
<p dir="auto">I’ll put it here as it may help someone, or someone else may have a better suggestion:</p>
<pre><code>targetTemperatureCell.insertBefore(frostCell, targetTemperatureCell.firstChild);
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/25995</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25995</guid><dc:creator><![CDATA[mongo116]]></dc:creator><pubDate>Sat, 29 Jul 2017 07:47:50 GMT</pubDate></item></channel></rss>