CSS how to make a fixed height?

前端 未结 9 1942
闹比i
闹比i 2020-12-06 04:22
相关标签:
9条回答
  • 2020-12-06 04:48

    I would have written

    <td style="height:50px">
    ...
    </td>
    
    0 讨论(0)
  • 2020-12-06 04:51

    Go with Div inside the td and using the css show the dots for overflow

    .box {
      width: 200px;
    }
    
    .clampMe {
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
    }
    
    .clampMe:after {
      display: none;
    }
    <!DOCTYPE html>
    <html>
    
    <head>
      <link rel="stylesheet" href="style.css">
      <script src="script.js"></script>
    </head>
    
    <body>
      <table border="1">
        <tr>
          <td>test</td>
          <td>test</td>
        </tr>
        <tr>
          <td>test</td>
          <td>test</td>
        </tr>
        <tr>
          <td class="box">
            <div class="clampMe">
              FASTag is a simple to use, reloadable tag which enables automatic deduction of toll charges and lets you pass through the toll plaza without stopping for the cash transaction. FASTag is linked to a prepaid account from which the applicable toll amount
              is deducted. The tag employs Radio-frequency Identification (RFID) technology and is affixed on the vehicle's windscreen after the tag account is active.
            </div>
          </td>
          <td>
            <div>testasdfasdfasd asdf asdf asdfas dffasdf asd</div>
          </td>
        </tr>
      </table>
    </body>
    
    </html>

    0 讨论(0)
  • 2020-12-06 04:57

    you're missing table rows


    <table  cellspacing="0" id="contactTable" style="table-layout:fixed; width:100%; font-weight:normal; position: absolute; top:45; left: 0;">
        <tr>
            <td style="padding-left:5px; overflow:hidden; height: 50px;">
                <span style="text-transform:capitalize;line-height:100%;">
                   //names here
                </span>                          
            </td>
        </tr>
    </table>
    
    0 讨论(0)
提交回复
热议问题