-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gutter between columns / body #160
Comments
Hello @EmmanuelBeziat Column doesn't support padding, you can just add the same padding on every element inside your column like this: <mj-column>
<mj-text padding="0 20px">...</mj-text>
<mj-anything padding="0 20px">...</mj-anything>
</mj-column>
<mj-column>
<mj-text padding="0 20px">...</mj-text>
<mj-anything padding="0 20px">...</mj-anything>
</mj-column> |
Hello, Nope, this won't work for what I need here — really spaces between columns, not inside. Here's a scheme : So at this point, each column contains two I was only able to achieve this by… Not using MJML for all this portion of the mail. This scheme is used 2 times in it, so basically using MJML was almost pointless for this project, I ended up with something like this :
Moreover, it forced me to add some classes and CSS to handle responsiveness of this handwrited html, so each time I compiled using MJML, I was forced to add some CSS in the output version, because I couldn't do it inside the MJML template. I had a dozen of mailing to do since the beginning of 2016, and most of them had some "plain-color" columns like this that need a gutter. This is why I think this would be really, really important to improve this system of columns, allowing some gap (maybe with an attribute ?) that would add some blank cells between actual ones. Thanks for your help anyway :) |
Hey @EmmanuelBeziat, a temporary solution could be adding an empty column set to the specific width you need in between but this will probably result in strangely sized columns if you leave them at the default 100% width. |
+1 @EmmanuelBeziat I totally agree with you, would be awesome if we can put gutters between cols to space them out. For now I use a dirty trick which is working fine:
|
Related to #204 |
Just a quick update on the issue here, we have found a solution for it, but it will require some refactor on how So we add a As of today But we need to solve the issue with |
Brace yourselves, |
On 3.X you can make a border of the same color as the background and add some width. For example if you have an
|
Gutters are available in the latest beta of MJML 4, install it with Here is how to reproduce the layout above (you can obviously adjust paddings to get the exact same result):
Which will produce this: |
@ngarnier Awesome! Thanks a lot, this will be very useful. |
wow was wondering how to reduce the gutter between two columns. then i found the answer of setting padding-left="0" to the child element like mj-text. why not just adding this to the docs? thanks |
Docs display default attribute value already on all elements, we can't do a CSS tutorial for each property here. |
its not about each property. its only about gutter width. the space between two columns. only topic i found it this https://documentation.mjml.io/#column-sizing |
I'm running into an issue here when I'm using a border on the columns. I have added a border to each of the columns and the padding does not work as expected. Borders should sit between the margin and padding: [margin] [border] [padding] [content]. It looks like mjml does not implement it in this way and puts the order as [margin] [padding] [border] [content].
Issue created - #2693 |
Yep as MJML tag doesn't produce a single tag it's a bit counter intuitive as it doesn't follow the box model. Use |
Thanks! |
Hi there,
I do need to have columns separated by some spaces. At this point I don't know how to achieve this…
Thanks for any help.
The text was updated successfully, but these errors were encountered: