2017-12-27 6 views
-1

I Tabellen-Layout haben alsauf Chrome Zooming verursacht CSS Position ändert

feste

table { 
 
    padding: 8px; 
 
    width: 100%; 
 
    table-layout: fixed; 
 
} 
 

 
td, 
 
th { 
 
    text-align: center; 
 
    padding: 8px; 
 
    table-layout: auto; 
 
}
<table> 
 
    <tr> 
 
    <th>Part No</th> 
 
    <th>Description</th> 
 
    <th style="text-align:center; width:100%; position:relative;z-index:5;">Part Status</th> 
 
    <th>Zone</th> 
 
    <th>Min Qty</th> 
 
    <th>Max Qty</th> 
 
    <th>Cost</th> 
 
    <th>Proposed Cost</th> 
 
    <th>Varience (%)</th> 
 
    <th style="text-align:center; width:100%;">Status</th> 
 
    <th>Pending Removal</th> 
 
    <th>Approvl Status</th> 
 
    <th>Locked</th> 
 
    <th>EffectiveDate</th> 
 
    </tr> 
 
</table>

Der Teil Status und Statusspalten dort TD seine Position zu verändern, wenn ich es auf -25% vergrößern oder verkleinern.

enter image description here

In Bild können Sie partstatus (6. Spalte) seine td Position geändert wird, finden. Kann mir jemand helfen, wie kann ich das lösen?

+0

Ja, willkommen auf Responsive Webdesign ... – baao

+0

Blick in Flexbox. PS: Das sind sehr viele Header. –

+0

Worum geht es bei dieser flexbox? Was müssen Änderungen machen, um es zu erledigen? @Highdef – Riya

Antwort

0

Verwenden Sie flex. display:inline-flex; auf dem Tisch.

table { 
 
    padding: 8px; 
 
    width: 100%; 
 
    table-layout: fixed; 
 
    display:inline-flex; 
 
} 
 

 
td, 
 
th { 
 
    text-align: center; 
 
    padding: 8px; 
 
    table-layout: auto; 
 

 
}
<table> 
 
    <tr> 
 
    <th>Part No</th> 
 
    <th>Description</th> 
 
    <th style="text-align:center; width:100%; position:relative;z-index:5;">Part Status</th> 
 
    <th>Zone</th> 
 
    <th>Min Qty</th> 
 
    <th>Max Qty</th> 
 
    <th>Cost</th> 
 
    <th>Proposed Cost</th> 
 
    <th>Varience (%)</th> 
 
    <th style="text-align:center; width:100%;">Status</th> 
 
    <th>Pending Removal</th> 
 
    <th>Approvl Status</th> 
 
    <th>Locked</th> 
 
    <th>EffectiveDate</th> 
 
    </tr> 
 
</table>

+0

Nein, es funktioniert nicht für mich. – Riya

+0

Boom fertig: 0-> das musste ich hinzufügen, ist es in der Tabelle oder th? @Hash – Riya

+0

add 'display: inline-flex;' zu Tabelle, ignorieren Sie das andere Bit :) – Hash

Verwandte Themen