Подтвердить что ты не робот

Как наверху, выравнивание текста влево в ячейке <td>, которая охватывает несколько строк

У меня есть следующий код html:

<table border="1">
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td rowspan="2">Save a lot</td>
  </tr>
  <tr>
    <td>March</td>
  </tr>
</table>

С помощью стилизации CSS или другого метода, могу ли я сделать текст "Сохранить много" сверху, слева оправдан?

4b9b3361

Ответ 2

 <td rowspan="2" style="text-align:left;vertical-align:top;padding:0">Save a lot</td>

Это должно сделать это.

Ответ 3

попробуйте это

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
    border: 1px solid black;
}
</style>
</head>
<body>

<table style="width:50%;">
    <tr>
      <th>Month</th>
      <th>Savings</th>
    </tr>
    <tr style="height:100px">
      <td valign="top">January</td>
      <td valign="bottom">$100</td>
    </tr>
</table>

<p><b>Note:</b> The valign attribute is not supported in HTML5. Use CSS instead.</p>

</body>
</html>