PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, November 16, 2022

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

 November 16, 2022     css, css-tables, html, vertical-alignment     No comments   

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 - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing