C
C
caof192020-05-07 14:57:40
css
caof19, 2020-05-07 14:57:40

Why is the cell height different from the given one?

Hello, I'm typing a letter for an email newsletter, at the moment I'm making a button, here's the code:

<table>
  <tr>
    <td width="40" height="10"></td>
      <td width="27" height="10" style="background: #0083C2; border-radius: 7px 0 0 0;"></td>
      <td style="background: #0083C2;" height="10"></td>
      <td width="27" height="10" style="background: #0083C2; border-radius: 0 7px 0 0;"></td>
      <td width="40" height="10"></td>
    </tr>
    <tr>
      <td width="40"></td>
      <td width="27" style="background: #0083C2;"></td>
      <td style="background: #0083C2;"><a style="color: #fff; text-decoration: none;font-size:17px;" href="">Подробнее</a></td>
      <td width="27" style="background: #0083C2;"></td>
      <td width="40"></td>
    </tr>
    <tr>
      <td width="40" height="10"></td>
      <td width="27" height="10" style="background: #0083C2; border-radius: 0 0 0 7px;"></td>
      <td style="background: #0083C2;" height="10"></td>
      <td width="27" height="10" style="background: #0083C2; border-radius: 0 0 7px 0;"></td>
      <td width="40" height="10"></td>
     </tr>
 </table>

Everything looks right in the browser: I
5eb3f76c4f4b4086412869.png
send it to the mail, and why the top and bottom rows become 21 pixels, instead of the specified 10
5eb3f7b276c69786022345.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Chuprik, 2020-05-08
@choupa

<a class = "like-button" href = "">Подробнее</a>

<style>
  .like-button  {
    color: white;
    font-size: 17px;
    font-family: arial;
    text-decoration: none;
    background: #0083C2;
    padding: 16px 32px;
    border: none;
    border-radius: 7px;
  };
</style>

The way you do, no one does for 20 years! Learn modern layout and CSS.
Table behavior is not predictable. How they determine the width of the cells there when pixels, percentages, auto are mixed in is a mystery to me (niasilil). I think that in your case the difference in cell heights is due to the fact that the mailman adds a space to empty cells. And the space is already a font of a certain height, so the cell is moved apart in height to fit it. To test my hypothesis, you can set empty cells to some very small font size (or vice versa very large), and see what happens.
But, again, this is only a sporting interest, and, I repeat, this is not necessary.
PS offtop: Does anyone still use Outlook these days?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question