Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2008
    Messaggi
    1,316

    Stesso width di th e td di due tabelle differenti

    codice:
    <!DOCTYPE html><html><head>
    <style>
     * {
        margin: 0;
        padding: 0;
        font-family: "Segoe UI", Arial, sans-serif;
    }
    table{
      width:100%;
    
    }
    .tbl-header{
      background-color: #fff;
      background-color: #f5f5f6
    
     }
    .tbl-content{
      height:300px;
      overflow-x:auto;
      margin-top: 0px;
    
    }
    th{    
    
      font-weight: bold;
      text-align: left;
      font-size: 12px;
      color: #949494;;
      text-transform: uppercase;
      width: 20px;
      padding:10px;
      border-right: 1px solid #ebebeb;
    }
    td{
    
      text-align: left;
      font-size: 12px;
      color: #fff;
      color: #949494;;
      border-bottom: 1px solid #ebebeb;
      border-right: 1px solid #ebebeb;
      width: 10px;
      padding:10px;
    }
    ::-webkit-scrollbar {
        width: 6px;
    } 
    ::-webkit-scrollbar-track {
        -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
    } 
    ::-webkit-scrollbar-thumb {
        -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
    }
    </style>
    </head><body>
    
      <div class="tbl-header">
        <table>
          <thead>
            <tr>
              <th>a</th>
              <th>b</th>
              <th>c</th>
              <th>d</th>
              <th>e</th>
            </tr>
          </thead>
        </table>
      </div>
      <div class="tbl-content">
        <table>
          <tbody>
            <tr>
              <td>dassd</td>
              <td>2123123 </td>
              <td>12231</td>
              <td>asdasdd</td>
              <td>sdaasd21323</td>
            </tr>
          </tbody>
        </table>
      </div>
    
    </body></html>
    Se salvate il codice noterete che i border dei th e td sono differenti.
    Come risolvo?

  2. #2
    Utente di HTML.it
    Registrato dal
    Jun 2008
    Messaggi
    1,316
    risolto usando le percentuali invece dei pixel

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.