I want a footnote in my output with a left-aligned long text string and a small right-aligned image. I can do this with the following code:
ods escapechar='^';
footnote1 "Very long text which wraps half-way across the page because of a design error" justify=right "^{style [postimage='image.png']}";
This works the same in both HTML and PDF. The text wraps half-way across the page. It looks something like this:
Very long text which wraps half-way across the page because of a [image]
design error
On inspecting the HTML I can see that SAS generates a table with two cells in this case. The widths are fixed at 50% each. In my view this is a design error. The widths should adapt to the contents with the auto table layout algorithm of CSS. A better solution would be to implement the separately aligned text strings with HTML SPAN elements and CSS style text-align, which can be left, center and right. Exactly the same applies to a title as it is also a table.
I have tried to work around this with no success. In HTML with CSS it is trivially simple to make an image or inline text float right. As I want this to work in HTML and PDF I have to use SAS's complex ODS.
Has anyone found a way to make ODS float an image right in a footnote without causing the footnote to be split into two table cells?
Version: SAS 9.4M5 64-bit on Windows 10.
Have you tried putting the image on a separate line below the main footer text? Like this:
ods escapechar='^';
footnote1 "Very long text which wraps half-way across the page because of a design error";
footnote2 justify=right "^{style [postimage='image.png']}";
From my own testing, it looks like that should accomplish what you are attempting to achieve.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.