How do you create a box where the address grows up instead of down for variable lines? I need the barcode and last line to stay positioned in the same spot for mailings.
I have tried, with no success, to select a position box and change the bottom position to a set number from the bottom of the page.
There may be other ways to do this, but I’d think a script would be the easiest.
Assuming you have either a 3 line address or a 4 line address, you just need to make an if statement that checks if that last line is empty or not. If you do something like the pseudo code below, your bottom line will always be in the same position since you’re padding the top with blanks.
Right mouse click the table cell and choose Cell… form the contextual menu.
Set the height for the cell, e.g. 1in.
CHange the Vertical Align property to bottom.
Regarding AlbertsN’s suggestion:
Wrap each address line a paragraph <p>. The layout engine will automatically collapse empty paragraphs. You may want to set the margin-bottom property to 0 (zero) to remove the extra spacing below the lines (e.g. via a stylesheet rule). Checkout the following sample. I’ve assigend an ID to my table (or table-cell) and changed the margin for the paragraphs in that element:
#my-address-block p {
margin-bottom: 0;
}
Alternatively use a Text Script as described in the following How To:
If you are using absolutely positioned box for the address, which should be default on master page, you could try this:
<div anchor="page_media_0"
style="position: absolute; overflow: hidden; -moz-box-sizing: border-box; width: 200px; height: 200px; top: 105.967px; left: 86px;" offset-x="86" offset-y="105.967">
<!-- this is absolutely positioned div created with "Insert Positioned Box" button -->
<div id="addr_bottom" style="overflow: hidden; height: auto; position: absolute; bottom: 0; width: 180px;">
<!-- this div sticking to the bottom of the outer div -->
@ADDRESS@
</div>
</div>
You can use the “flex” CSS properties. Assuming you have a Text Script named “@AddressBlock@”, this code will work to create a bottom-aligned Address Block.
In case anybody is still looking for this in 2021, Erik’s solution is the only one that works. Example for address block aligned for the use with a C5 windowed envelope as follows: