So, if you come across this question in the future, and you are looking for a solution for your Website, than I highly recommend you to use CSS instead of the deprecated HTML Attributes cellpadding
and cellspacing
! You could either define it inline, so it may feels a bit like cellpadding
, but preferably you should write this declarations in an external CSS File and define something like
td {
padding: 5px; /* cellpadding */
margin: 5px; /* cellspacing */
}
You can even set the padding
and margin
of every single side of the element like this:
td {
padding: 5px 10px 15px 20px; /* top, right, bottom, left */
margin: 5px 10px 15px 20px; /* equal to padding */
}
Now, if you came across this question, because you are currently developing an HTML Email Template, than at first take my condolences. It is a realy horrible task, even (or especially) these days.
Writing HTML Emails is the only excuse to use deprecated HTML Elements and Attributes instead of up-to-date CSS Solutions, because the handling of CSS is very different from Email Client to Email Client, and most of them have some legacy support for deprecated Stuff. In every case, you should test as much as possible, to check out, if there may is an CSS solution, which works across the most common Clients (different Browser-, and Webclients, Outlook, Win10 Mail App, iOS and Android native Mail Apps, Inbox or Gmail App, and so on...). If it works: use CSS! Only use the old fashioned HTML, if this works better.
In every case you need to use inline CSS declarations, because most Email Clients cut off CSS defined in the <head>
, and they won't load external files at all.
And now, to answer the question: with cellpadding
and cellspacing
it is not possible to set an individual padding or spacing for each side, you can just specify a number which applies to every side, unfortunately. But in this specific case, i think it is safe to use inline css with padding and / or margin, which is supported by most of the Email Clients, as far as I remember.