【问题标题】:How do I make the text start at the bottom within the cell of a table?如何使文本从表格单元格的底部开始?
【发布时间】:2021-02-19 23:10:20
【问题描述】:

我想知道是否有人可以提供帮助。

我正在尝试在此单元格/表格的底部显示以下文本 - 有人可以帮忙吗?

    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>

【问题讨论】:

    标签: html css text css-tables writing


    【解决方案1】:

    使用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>

    【讨论】:

      猜你喜欢
      • 2016-01-07
      • 2020-07-15
      • 2013-08-15
      • 1970-01-01
      • 2011-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多