0

I am inserting a dataframe into an HTML MIME email that I am sending out. Some columns need to be left aligned, and others need to be right aligned. I have gone through various posts, and it seems the only option is to use CSS. Before I commit to this method, can anyone tell me if there is an easier, more practical method of aligning the various columns?

So far the best answer I've found that uses CSS is https://stackoverflow.com/a/50939211/9414465

1 Answers1

0

Have you considered a script that reopens the HTML document and inserts an html alignment tag (<td align="right">) per cell?

MvZ
  • 231
  • 1
  • 5
  • I had almost linked you the column alignment tag ``, but there are no browsers that support that tag. That has once cost me an afternoon to figure out. – MvZ Dec 13 '18 at 14:25
  • I did try that, but it affected every column, not just a single column. – Drew Aschenbrener Dec 13 '18 at 15:50
  • If you precompute a vector of alignment tags (each tag corresponding to a cell in the html document's table), then iterate over the cells, inserting the corresponding alignment attribute in each cell's `` tag, you should be able to set a deviant tag for the cells that correspond to a specific column. This works perfectly in Outlook 365, as well as most major browsers. I can't find solid info on compatibility with other email clients. Campaign monitor does show that info for css tags, and no solution is universally supported: https://www.campaignmonitor.com/css/flexbox/align-content/ – MvZ Dec 14 '18 at 07:55