packages/heml-inline/src/inlineMargins.js
function inlineMargins ($) {
  $('table[style*=margin]').toNodes().forEach(($el) => {
    const { left, right } = getSideMargins($el.attr('style'))

    if (left === 'auto' && right === 'auto') {
      $el.attr('align', 'center')
    } else if (left === 'auto' && right !== 'auto') {
      $el.attr('align', 'right')
    } else if (left !== 'auto') {
      $el.attr('align', 'left')
    }
  })
}
function inlineMargins ($) {
  $('table[style*=margin]').toNodes().forEach(($el) => {
    const { left, right } = getSideMargins($el.attr('style'))

    if (left === 'auto' && right === 'auto') {
      $el.attr('align', 'center')
    } else if (left === 'auto' && right !== 'auto') {
      $el.attr('align', 'right')
    } else if (left !== 'auto') {
      $el.attr('align', 'left')
    }
  })
}
function inlineMargins ( $ ) { $ ( 'table[style*=margin]' ) . toNodes ( ) . forEach ( ( $el ) => { const { left , right } = getSideMargins ( $el . attr ( 'style' ) ) if ( left === 'auto' && right === 'auto' ) { $el . attr ( 'align' , 'center' ) } else if ( left === 'auto' && right !== 'auto' ) { $el . attr ( 'align' , 'right' ) } else if ( left !== 'auto' ) { $el . attr ( 'align' , 'left' ) } } ) }
finds all the tables that are centered with margins
and centers them with the align attribute
@param  {Cheerio} $
finds all the tables that are centered with margins and centers them with the align attribute