如何对齐表格行

问题描述 投票:0回答:1

我在CSS中使用普通的html表。我想对齐表格行元素。我给了td作为填充样式。在“标题”中,td不能完全对齐。enter image description here请帮助我

 <tr class="custom-tr">
  <td class="custom-td">ESSENTIAL PC ANTIVIRUS</td>
  <td class="custom-td">ESSENTIAL PC ANTIVIRUS ESSENTIAL PC ANTIVIRUS</td>
  <td class="custom-td">Essential</td><td class="custom-td">ESSEL1</td>

<style>
  table {
     border-collapse: collapse;
  } 
 .custom-tr {
    border-bottom: 1px solid #dcdfe2;
    color: #949EBF;
    font-weight: 200;
 }
 .custom-td {
   padding: 10px 5px 10px 0;
   font-size: 14px;
 }

enter image description here

如果我添加vertical-align:top;或纵向对齐:基线;看起来不好enter image description here

html css
1个回答
0
投票

vertical-align: baseline;用于td

© www.soinside.com 2019 - 2024. All rights reserved.