How do I make the text start at the bottom within the cell of a table?

Issue

I am trying to get the following text to display at the bottom of this cell/table:

    b.vertical {
        writing-mode: vertical-lr;
        transform: rotate(-180deg);
    }
<!DOCTYPE html>
<html>
<title>W3.CSS Template</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<head>

</head>
<body>

<table class="w3-table w3-border" >
<th width="10%" class="w3-medium w3-border w3-green w3-center"><b class="vertical">Customer</b></th>
<th width="10%" class="w3-medium w3-border w3-green w3-center"><b class="vertical">Order Date</b></th>
<th width="10%" class="w3-medium w3-border w3-green w3-center"><b class="vertical">INV No</b></th>
<th width="10%" class="w3-medium w3-border w3-green w3-center"><b class="vertical">PO Number</b></th>       
<th width="10%" class="w3-medium w3-border w3-green w3-center"><b class="vertical">Pale Ale Draught Style 355ml Can 5.0% ABV x 12</b></th>
          </tr>
</thead>
<tbody>
            

</body>
</html>

Solution

use vertical-align:bottom

b.vertical {
  writing-mode: vertical-lr;
  transform: rotate(-180deg);
}

table.w3-table th {
   vertical-align:bottom;
}
<!DOCTYPE html>
<html>
<title>W3.CSS Template</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<head>

</head>

<body>

  <table class="w3-table w3-border">
  <tr>
    <th width="10%" class="w3-medium w3-border w3-green w3-center"><b class="vertical">Customer</b></th>
    <th width="10%" class="w3-medium w3-border w3-green w3-center"><b class="vertical">Order Date</b></th>
    <th width="10%" class="w3-medium w3-border w3-green w3-center"><b class="vertical">INV No</b></th>
    <th width="10%" class="w3-medium w3-border w3-green w3-center"><b class="vertical">PO Number</b></th>
    <th width="10%" class="w3-medium w3-border w3-green w3-center"><b class="vertical">Pale Ale Draught Style 355ml Can 5.0% ABV x 12</b></th>
    </tr>
    </thead>
    <tbody>


</body>

</html>

Answered By – Temani Afif

Answer Checked By – Katrina (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.