Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/236.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 调整所有移动设备的DIV表大小_Php_Html_Css_Media Queries_Responsive - Fatal编程技术网

Php 调整所有移动设备的DIV表大小

Php 调整所有移动设备的DIV表大小,php,html,css,media-queries,responsive,Php,Html,Css,Media Queries,Responsive,我在移动设备上找不到一张需要正确调整大小的桌子。(iPhone、Pixel等)这是因为我的DIV表对于移动设备来说太宽了。它在iPad、笔记本电脑等上看起来不错,但在手机上太宽了。我在导航栏中使用了媒体查询,但这有点复杂,因为它是我从PHP显示的一个表 <html> <head> <style> .table{ display: table; marg

我在移动设备上找不到一张需要正确调整大小的桌子。(iPhone、Pixel等)这是因为我的DIV表对于移动设备来说太宽了。它在iPad、笔记本电脑等上看起来不错,但在手机上太宽了。我在导航栏中使用了媒体查询,但这有点复杂,因为它是我从PHP显示的一个表

<html>
    <head>
        <style>


        .table{ 
                display: table;
                margin-left: auto;
                margin-right: auto;
                text-align: left;

            }

@media only screen and (max-width: 600px) {

}

            .tr{ 
                display: table-row; 
                padding: 1px;
            }
            .td{ 
                display: table-cell;
                padding: 5px;
            }
            .padding {
                padding: 12px;
                margin: auto;
            }


        </style>
    </head>
<body> 

<div>
    <div class ="top">
            <center><h1 class="profile">Ticket #<?php echo $id ?></h1></center>
    </div>

    <hr>

        <?php     
            $sql = "select a.id, a.lname, a.fname, a.phonenum, a.room, a.building, a.issue, a.start_time, a.end_time, a.description, a.username
            from appointments as a
            where a.email = '". $_SESSION['email'] ."' and id = '$id'
            ";


            $result = $conn->query($sql);

            if ($result->num_rows > 0) {
                echo " <div class='table'>
                <div class='tr'>
                <div class='td'><b>Ticket #</b></div>
                <div class='td'><b>Username</b></div>
                <div class='td'><b>Name</b></div>
                <div class='td'><b>Residence</b></div>
                <div class='td'><b>Issue</b></div>
                <div class='td'><b>Date</b></div>
                <div class='td'><b>Appointment Time</b></div>
                </div>";
                // output data of each row
                while($row = $result->fetch_assoc()) {
                    $starttime = strtotime($row["start_time"]); //converts date time received from MySQL into a string
                    $endtime = strtotime($row["end_time"]);
                    $date = date("m/d/y", $starttime);
                    $start = date("g:i A", $starttime);
                    $end = date("g:i A", $endtime);
                    $building = str_replace('_',' ', $row["building"]);
                    echo "<div class='tr'>
                    <div class='td'>".$row["id"]."</div>
                    <div class='td'>".$row["username"]."</div>
                    <div class='td'>".$row["fname"].' '.$row["lname"]."</div>
                    <div class='td'>".$building." ".$row["room"]."</div>
                    <div class='td'>".$row["issue"]."</div>
                    <div class='td'>".$date."</div>
                    <div class='td'>".$start.'-'.$end."</div>
                    </div>";
                    $description = $row["description"];
                }
                echo "</div>";
                echo "<br><hr><p>
                <center><h2>Issue Description</h2></center>
                <center>$description</center <br><br>
                ";
            } else {
                echo "<br/>Error</b>";
            }

        ?>
</div>



<?php

require 'includes/footer.php';



.表{
显示:表格;
左边距:自动;
右边距:自动;
文本对齐:左对齐;
}
@仅介质屏幕和(最大宽度:600px){
}
tr{
显示:表格行;
填充:1px;
}
.td{
显示:表格单元格;
填充物:5px;
}
.填充{
填充:12px;
保证金:自动;
}
票#


这里有一个可能的解决方案。在
600px
(本例中我正在呼叫该手机)下,将
显示更改为
flex
(行方向),并将每个
tr
子显示更改为
flex
(列方向)

我添加的主要内容如下:

@媒体屏幕和(最大宽度:600px){
身体,桌子{
显示器:flex;
柔性包装:nowrap;
证明内容:中心;
}
.table.tr{
显示器:flex;
弯曲方向:立柱;
}
.table.td{
空白:nowrap;
}
}
演示
h2{
利润率:20像素45像素;
}
h1{
文本对齐:居中;
}
p{
利润率:20像素45像素;
}
.反应迅速{
宽度:100%;
高度:自动;
}
身体{
保证金:0;
}
ul导航{
列表样式类型:无;
保证金:0;
填充:0;
溢出:隐藏;
背景色:rgb(119,13,41);
}
李国宝{
浮动:左;
}
ul.nav李安{
显示:块;
颜色:白色;
文本对齐:居中;
填充:14px 16px;
文字装饰:无;
字体系列:“开放式Sans”,Arial;
字体风格:普通;
字体大小:300;
}
ul.nav li a:悬停:未(.active){
背景色:rgb(237235235);
颜色:rgb(119,13,41);
}
ul.nav-lia.active{
背景色:rgb(169,5,51);
}
ul.nav-li.对{
浮动:对;
}
@媒体屏幕和屏幕(最大宽度:600px){
ul.nav-li.对,
李国宝{
浮动:无;
}
}
桌子
th,
运输署{
边界:0px;
左边距:自动;
右边距:自动;
文本对齐:左对齐;
}
运输署{
填充:7px;
字体系列:“开放式Sans”,Arial;
字体大小:300;
字号:18px;
}
th{
填充:7px;
字体系列:格鲁吉亚;
字体大小:400;
字体大小:22px;
}
.桌子{
显示:表格;
左边距:自动;
右边距:自动;
文本对齐:左对齐;
}
@仅介质屏幕和(最大宽度:600px){
.td{
宽度:50%;
}
}
.tr{
显示:表格行;
填充:1px;
}
.td{
显示:表格单元格;
填充物:5px;
}
.填充{
填充:12px;
保证金:自动;
}
@媒体屏幕和屏幕(最大宽度:600px){
身体,桌子{
显示器:flex;
柔性包装:nowrap;
证明内容:中心;
}
.table.tr{
显示器:flex;
弯曲方向:立柱;
}
.table.td{
空白:nowrap;
}
}

车票#123461

票# 用户名 名称 住宅 问题 日期 预约时间 123461 用户名 无名氏 5号宿舍 无线网络不工作 06/01/19 下午12:00-12:50

问题说明 在pharetra的发酵菌facilisis lorem中。福斯·马萨·阿库,阿库赛德的蒂尼登,佩伦茨克·奥古斯。维韦拉·莫里斯(Curabitur viverra mauris id magna ultricies tristique vitae nec sapien)是一位杰出的艺术家。南阿利奎特pulvinar tincidunt。生命中的小相位 法雷特拉。努克设施位于苏打水元素turpis tincidunt。Vivamus sed molestie tellus,feugiat metus调味品。
分区页脚{ 保证金:自动; 文本对齐:居中;
}
这里有一个可能的解决方案。在
600px
(本例中我正在呼叫该手机)下,将
显示更改为
flex
(行方向),并将每个
tr
子显示更改为
flex
(列方向)

我添加的主要内容如下:

@媒体屏幕和(最大宽度:600px){
身体,桌子{
显示器:flex;
柔性包装:nowrap;
证明内容:中心;
}
.table.tr{
显示器:flex;
弯曲方向:立柱;
}
.table.td{
空白:nowrap;
}
}
演示
h2{
利润率:20像素45像素;
}
h1{
文本对齐:居中;
}
p{
利润率:20像素45像素;
}
.反应迅速{
宽度:100%;
高度:自动;
}
身体{
保证金:0;
}
ul导航{
列表样式类型:无;
保证金:0;
填充:0;
溢出:隐藏;
背景色:rgb(119,13,41);
}
李国宝{
浮动:左;
}
ul.nav李安{
显示:块;
颜色:白色;
文本对齐:居中;
填充:14px 16px;
文字装饰:无;
字体系列:“开放式Sans”,Arial;
字体风格:普通;
字体大小:300;
}
ul.nav li a:悬停:未(.active){
背景色:rgb(237235235);
颜色:rgb(119,13,41);
}
ul.nav-lia.active{
背景色:rgb(169,5,51);
}
ul.nav-li.对{
浮动:对;
}
@媒体屏幕和屏幕(最大宽度:600px){
ul.nav-li.对,
李国宝{
浮动:无;
}
}
桌子
th,
运输署{
边界:0px;
左边距:自动;
右边距:自动;
文本对齐:左对齐;
}
运输署{
填充:7px;
字体系列:“开放式Sans”,Arial;
字体大小:300;
字号:18px;
}
th{
填充:7px;
字体系列:格鲁吉亚;
字体大小:400;
字体大小:22px;
}
.桌子{
显示:表格;
左边距:自动;
右边距:自动;
文本对齐:左对齐;
}
@仅介质屏幕和(最大宽度:600px){
.td{
宽度:50%;
}
}
.tr{
显示:表格行;
填充:1px;
}
.td{
显示:表格单元格;
填充物:5px;
}
.填充{
填充:12px;
保证金:自动;
}
@媒体屏幕和屏幕(最大宽度:600p