# Template canvas set gap to 0

**URL:** <https://forum.inductiveautomation.com/t/template-canvas-set-gap-to-0/59752>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 18, 2022, 9:45pm UTC](https://forum.inductiveautomation.com/t/template-canvas-set-gap-to-0/59752 "2022-05-18T21:45:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [May 18, 2022, 9:45pm UTC](https://forum.inductiveautomation.com/t/template-canvas-set-gap-to-0/59752/1 "2022-05-18T21:45:41Z")

</div>

Hi there,

I’m trying to use the Template Canvas **Layout Positioning** mode to put a few templates in a row.  
Its a fairly simple application, there will only be one row of components, only two different templates will be used.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/b/3b2ef252f6bad1d44f7bbacd7ade4b551b99c897.png)

Without applying any special layout settings, i get gaps between the components.  
How can i reduce these to 0? Or small enough that the components actually touch?

I’ve had a look through these MIG component resources, but applying all sorts of combinations of “gap” and “gapx” didn’t really do anything for me.

[http://migcalendar.com/miglayout/cheatsheet.html](http://migcalendar.com/miglayout/cheatsheet.html)

[https://stackoverflow.com/questions/14389447/set-default-gap-to-0-in-mig-layout](https://stackoverflow.com/questions/14389447/set-default-gap-to-0-in-mig-layout)

Non-zero values for min:preferred:max gap size seem to work, as below:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/7/d71dba4d687770de20340f71314c06931f1919c4.png)

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [May 18, 2022, 9:57pm UTC](https://forum.inductiveautomation.com/t/template-canvas-set-gap-to-0/59752/2 "2022-05-18T21:57:17Z")

</div>

Note: I can certainly use the **Absolute Positioning** method to get what i want, but i would like to avoid having to manually calculate all the position parameters if possible.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/2/42588a95596c2e32fdb5ba837cb7e039966beb6d.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 18, 2022, 10:19pm UTC](https://forum.inductiveautomation.com/t/template-canvas-set-gap-to-0/59752/3 "2022-05-18T22:19:16Z")

</div>

Change the ‘Layout Constraints’ property of the template canvas itself to include `gap 0`:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/78e1405b760f564c3ac28938d3ed0d1cbacd8054.png)

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [May 18, 2022, 10:24pm UTC](https://forum.inductiveautomation.com/t/template-canvas-set-gap-to-0/59752/4 "2022-05-18T22:24:06Z")

</div>

Ah perfect thanks, i was wondering how to control the global settings. That did the trick.

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [May 18, 2022, 11:04pm UTC](https://forum.inductiveautomation.com/t/template-canvas-set-gap-to-0/59752/5 "2022-05-18T23:04:39Z")

</div>

@paul-griffith do you know how to return a “{” inside a mysql select query so that the **paramters** part of the dataset can be returned via a query?  
Struggling a bit to get that final piece of the puzzle sorted so that i can generate this dataset from a mysql query.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/c/cc63437bffa8cf01ef223257c7f5943848432d03.png)

It seems like mysql treats “{}” characters as delimeters or something. Or something gets converted to a “path” in mysql.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 18, 2022, 11:20pm UTC](https://forum.inductiveautomation.com/t/template-canvas-set-gap-to-0/59752/6 "2022-05-18T23:20:51Z")

</div>

Maybe try `JSON_QUOTE(column)` in your query?

[https://database.guide/json\_quote-how-to-escape-characters-in-strings-used-as-json-values-in-mysql/](https://database.guide/json_quote-how-to-escape-characters-in-strings-used-as-json-values-in-mysql/)

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [May 18, 2022, 11:43pm UTC](https://forum.inductiveautomation.com/t/template-canvas-set-gap-to-0/59752/7 "2022-05-18T23:43:59Z")

</div>

Thanks for the point in the right direction.  
using JSON\_OBJECT works, as per this manual page:  
([MySQL :: MySQL 8.0 Reference Manual :: 11.5 The JSON Data Type](https://dev.mysql.com/doc/refman/8.0/en/json.html))

```auto
	JSON_OBJECT('cut_index',row_id) AS "parameters",

```
