2017-06-27 4 views
-3

Ich habe eine Website auf dieser Website Ich habe eine reaktionsschnelle Tabelle für Fußball-Tipps. So kann ich bereits mit der Datenbank verbinden, um Datum zu holen, und es zeigt mir auf dem Desktop.so funktioniert es auf dem Desktop, aber auf dem Handy kann ich nichts sehen. Ich legte den HTML-Code und den CSS-Code nach unten. also bin ich ein Anfänger also bitte hilf mir.Abrufen von Daten von Mysql funktioniert nicht Handy nur Desktop

table { 
 
    border-spacing: 1; 
 
    border-collapse: collapse; 
 
    background: #FFED86; 
 
    border-radius: 6px; 
 
    overflow: hidden; 
 
    max-width: 800px; 
 
    width: 100%; 
 
    margin: 0 auto; 
 
    position: relative; 
 
} 
 
table * { 
 
    position: relative; 
 
} 
 
table td, table th { 
 
    padding-left: 8px; 
 
} 
 
table thead tr { 
 
    height: 60px; 
 
    background: #FFED86; 
 
    font-size: 16px; 
 
} 
 
table tbody tr { 
 
    height: 48px; 
 
    border-bottom: 1px solid #000000; 
 
} 
 
table tbody tr:last-child { 
 
    border: 0; 
 
} 
 
table td, table th { 
 
    text-align: left; 
 
} 
 
table td.l, table th.l { 
 
    text-align: right; 
 
} 
 
table td.c, table th.c { 
 
    text-align: center; 
 
} 
 
table td.r, table th.r { 
 
    text-align: center; 
 
} 
 

 
@media screen and (max-width: 35.5em) { 
 
    table { 
 
    display: block; 
 
    } 
 
    table > *, table tr, table td, table th { 
 
    display: block; 
 
    } 
 
    table thead { 
 
    display: none; 
 
    } 
 
    table tbody tr { 
 
    height: auto; 
 
    padding: 8px 0; 
 
    } 
 
    table tbody tr td { 
 
    padding-left: 45%; 
 
    margin-bottom: 12px; 
 
    } 
 
    table tbody tr td:last-child { 
 
    margin-bottom: 0; 
 
    } 
 
    table tbody tr td:before { 
 
    position: absolute; 
 
    font-weight: 700; 
 
    width: 40%; 
 
    left: 10px; 
 
    top: 0; 
 
    } 
 
    table tbody tr td:nth-child(1):before { 
 
    content: "HOME"; 
 
    } 
 
    table tbody tr td:nth-child(2):before { 
 
    content: "AWAY"; 
 
    } 
 
    table tbody tr td:nth-child(3):before { 
 
    content: "TIP"; 
 
    } 
 
    table tbody tr td:nth-child(4):before { 
 
    content: "ODD"; 
 
    } 
 
    table tbody tr td:nth-child(5):before { 
 
    content: "DATE"; 
 
    } 
 
    table tbody tr td:nth-child(6):before { 
 
    content: "TIME"; 
 
    } 
 
} 
 
body { 
 
    background: #50040d; 
 
    font: 400 14px 'Calibri','Arial'; 
 
    padding: 20px; 
 
} 
 

 
blockquote { 
 
    color: #ffed86; 
 
    text-align: center;
<?php 
 
//including the database connection file 
 
include_once("config.php"); 
 
    
 
//fetching data in descending order (lastest entry first) 
 
$result = $dbConn->query("SELECT * FROM users ORDER BY id DESC"); 
 
?> 
 

 
<!DOCTYPE html> 
 
<html > 
 
<head> 
 
    <meta charset="UTF-8"> 
 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
 
    <title>Best Soccer Tips</title> 
 
    
 
    
 
    
 
     <link rel="stylesheet" href="css/style.css"> 
 

 
    
 
</head> 
 
<blockquote> <strong>Best Soccer Tips</strong> </blockquote> 
 

 
<body> 
 

 
     <table> 
 
     <thead> 
 
     <tr> 
 
      <th>HOME</th> 
 
      <th>AWAY</th> 
 
      <th>TIP</th> 
 
      <th>ODD</th> 
 
      <th>DATE</th> 
 
      <th>TIME</th> 
 
     </tr> 
 
    <?php  
 
    while($row = $result->fetch(PDO::FETCH_ASSOC)) {   
 
     echo "<tr>"; 
 
     echo "<td>".$row['home']."</td>"; 
 
     echo "<td>".$row['away']."</td>"; 
 
     echo "<td>".$row['tip']."</td>"; 
 
     echo "<td>".$row['odd']."</td>"; 
 
     echo "<td>".$row['date']."</td>"; 
 
     echo "<td>".$row['time']."</td>";  
 
       
 
    } 
 
    ?> 
 
    <link rel="stylesheet" href="css/style.css"> 
 

 
     
 
     
 
    <table/> 
 
     
 
    <blockquote> <strong>Best Soccer Tips</strong> </blockquote> 
 
     <blockquote> <strong>Good Luck</strong> </blockquote> 
 
    
 
    
 
</body>

+0

versuchen mit '@media Bildschirm und (max-width: 35.5em) {' richtige Medien fragen –

+0

@media Bildschirm und (max-width: 35.5em) { Tabelle { Anzeige: Block; – Murat

+0

schon da aber kein effekt.wenn ich den browser kleiner mache wie unter 600 px zeige mir meine tabelle über 600 alles funktioniert gleich auf mobil mit dektop zeige es zeigt aber mobil nur die blockquotes aber nicht die tabelle – Murat

Antwort

0

Schließen Sie <table>, <thead> und verwenden <tbody> wo Sie Zeilen erhalten. und versuchen unter Beispiel

table { 
 
    border-spacing: 1; 
 
    border-collapse: collapse; 
 
    background: #FFED86; 
 
    border-radius: 6px; 
 
    overflow: hidden; 
 
    max-width: 800px; 
 
    width: 100%; 
 
    margin: 0 auto; 
 
    position: relative; 
 
} 
 
table * { 
 
    position: relative; 
 
} 
 
table td, table th { 
 
    padding-left: 8px; 
 
} 
 
table thead tr { 
 
    height: 60px; 
 
    background: #FFED86; 
 
    font-size: 16px; 
 
} 
 
table tbody tr { 
 
    height: 48px; 
 
    border-bottom: 1px solid #000000; 
 
} 
 
table tbody tr:last-child { 
 
    border: 0; 
 
} 
 
table td, table th { 
 
    text-align: left; 
 
} 
 
table td.l, table th.l { 
 
    text-align: right; 
 
} 
 
table td.c, table th.c { 
 
    text-align: center; 
 
} 
 
table td.r, table th.r { 
 
    text-align: center; 
 
} 
 

 
@media screen and (max-width: 35.5em) { 
 
    table { 
 
    display: block; 
 
    } 
 
    table > *, table tr, table td, table th { 
 
    display: block; 
 
    } 
 
    table thead { 
 
    display: none; 
 
    } 
 
    table tbody tr { 
 
    height: auto; 
 
    padding: 8px 0; 
 
    } 
 
    table tbody tr td { 
 
    padding-left: 45%; 
 
    margin-bottom: 12px; 
 
    } 
 
    table tbody tr td:last-child { 
 
    margin-bottom: 0; 
 
    } 
 
    table tbody tr td:before { 
 
    position: absolute; 
 
    font-weight: 700; 
 
    width: 40%; 
 
    left: 10px; 
 
    top: 0; 
 
    } 
 
    table tbody tr td:nth-child(1):before { 
 
    content: "HOME"; 
 
    } 
 
    table tbody tr td:nth-child(2):before { 
 
    content: "AWAY"; 
 
    } 
 
    table tbody tr td:nth-child(3):before { 
 
    content: "TIP"; 
 
    } 
 
    table tbody tr td:nth-child(4):before { 
 
    content: "ODD"; 
 
    } 
 
    table tbody tr td:nth-child(5):before { 
 
    content: "DATE"; 
 
    } 
 
    table tbody tr td:nth-child(6):before { 
 
    content: "TIME"; 
 
    } 
 
} 
 
body { 
 
    background: #50040d; 
 
    font: 400 14px 'Calibri','Arial'; 
 
    padding: 20px; 
 
} 
 

 
blockquote { 
 
    color: #ffed86; 
 
    text-align: center; 
 
    }
<blockquote> <strong>Best Soccer Tips</strong> </blockquote> 
 

 
<body> 
 

 
     <table> 
 
     <thead> 
 
     <tr> 
 
      <th>HOME</th> 
 
      <th>AWAY</th> 
 
      <th>TIP</th> 
 
      <th>ODD</th> 
 
      <th>DATE</th> 
 
      <th>TIME</th> 
 
     </tr> 
 
     </thead> 
 
<tbody> 
 
     <tr> 
 
      <th>HOME</th> 
 
      <th>AWAY</th> 
 
      <th>TIP</th> 
 
      <th>ODD</th> 
 
      <th>DATE</th> 
 
      <th>TIME</th> 
 
     </tr>  <tr> 
 
      <th>HOME</th> 
 
      <th>AWAY</th> 
 
      <th>TIP</th> 
 
      <th>ODD</th> 
 
      <th>DATE</th> 
 
      <th>TIME</th> 
 
     </tr>  <tr> 
 
      <th>HOME</th> 
 
      <th>AWAY</th> 
 
      <th>TIP</th> 
 
      <th>ODD</th> 
 
      <th>DATE</th> 
 
      <th>TIME</th> 
 
     </tr> 
 
     </tbody> 
 
     </table> 
 
     
 
    <blockquote> <strong>Best Soccer Tips</strong> </blockquote> 
 
     <blockquote> <strong>Good Luck</strong> </blockquote> 
 

+0

i nur und Werke geschlossen. danke, du bist der beste Pankaj – Murat

+0

Bitte stimme für die richtige Antwort und akzeptiere sie –

+0

bitte erklären Sie mir, wie ich stimme – Murat

Verwandte Themen