zoukankan      html  css  js  c++  java
  • 如何将多行数据以分组的形式对齐到单元格的上,中或下位置

    将多行数据显示在一个单元格中,然后使用vertical-align,将他们自动对齐到单元格的上边,中间或下边。

     1 <!DOCTYPE html>
     2 <html>
     3 <head lang="en">
     4     <meta charset="UTF-8">
     5     <title></title>
     6     <style>
     7         .align-top{height: 200px;vertical-align:top; }
     8         .align-middle{height: 200px;vertical-align: middle;}
     9         .align-bottom{height: 200px;vertical-align: bottom;}
    10     </style>
    11 
    12 </head>
    13 <body>
    14 <h1>Verticla-aligned Data</h1>
    15 <table>
    16     <tr>
    17         <td class="align-top">These lines of text are vertically aligned to the top of the cell</td>
    18         <td class="align-middle">These lines of text are vertically aligned to the middle of the cell</td>
    19         <td class="align-bottom">These lines of text are vertically aligned to the bottom of the cell</td>
    20     </tr>
    21 </table>
    22 
    23 
    24 </body>
    25 </html>

     可以利用display:table,  display:table-row和display:table-cell规则,可以将元素转化为表格,行和单元格~ 

  • 相关阅读:
    C#监听文件
    用bootstrapValidator来验证UEditor
    .net 在不同情况下调用带soapheader的webservice的方式
    MyBatis1
    随堂笔记2
    数学复习笔记 2018年-2019年
    药方
    随堂笔记一
    友谊藏在门背后,2
    友谊藏在门背后
  • 原文地址:https://www.cnblogs.com/s-z-y/p/4475874.html
Copyright © 2011-2022 走看看