Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.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
试图将sql数据库显示到php网页中,CSS不起作用_Php_Css_Sql_Html_Wamp - Fatal编程技术网

试图将sql数据库显示到php网页中,CSS不起作用

试图将sql数据库显示到php网页中,CSS不起作用,php,css,sql,html,wamp,Php,Css,Sql,Html,Wamp,我试图在php网页中将sql数据库显示到一个表中。一开始一切都很顺利。但是当我插入CSS时,表格没有工作,我也不知道为什么。我试图重新定位代码,但它也不起作用:( 感谢您的帮助!您在While循环后缺少一个,这可能会破坏您的表: //table with data while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['name'] . "</td>"; echo

我试图在php网页中将sql数据库显示到一个表中。一开始一切都很顺利。但是当我插入CSS时,表格没有工作,我也不知道为什么。我试图重新定位代码,但它也不起作用:(

感谢您的帮助!

您在While循环后缺少一个
,这可能会破坏您的表:

//table with data
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['position'] . "</td>";
echo "<td>" . $row['unit'] . "</td>";
echo "<td>" . $row['department'] . "</td>";
echo "<td>" . $row['telefon'] . "</td>";
echo "<td>" . $row['faks'] . "</td>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['data'] . "</td>";
echo "<td>" . $row['reason'] . "</td>";
echo "</tr>";  // Add this in
}
//包含数据的表
while($row=mysql\u fetch\u数组($result))
{
回声“;
回显“$row['name']”;
回显“$row['position']”;
回显“$行[“单位]”;
回显“$行[“部门]”;
echo“$row['telefon']”;
回显“$row['faks']”;
回显“$row['email']”;
回显“$row['data']”;
回显“$row['reason']”;
echo”“;//将此添加到
}

向我们展示CSS。上面显示的只是文件的
包含部分。抱歉,我添加了CSS的哪些部分不起作用?您有内联样式“”,将覆盖CSS文件中的任何内容,即。tablee width=100%@user934902即使我没有内联样式,CSS部分也不起作用。。
.tablee {
    margin:0px;padding:0px;
    width:100%;
    box-shadow: 10px 10px 5px #888888;
    border:1px solid #000000;
    -moz-border-radius-bottomleft:9px;
    -webkit-border-bottom-left-radius:9px;
    border-bottom-left-radius:9px;
    -moz-border-radius-bottomright:9px;
    -webkit-border-bottom-right-radius:9px;
    border-bottom-right-radius:9px;
    -moz-border-radius-topright:9px;
    -webkit-border-top-right-radius:9px;
    border-top-right-radius:9px;
    -moz-border-radius-topleft:9px;
    -webkit-border-top-left-radius:9px;
    border-top-left-radius:9px;
}

.tablee table {
    width:100%;
    height:100%;
    margin:0px;padding:0px;
}

.tablee tr:last-child td:last-child {
    -moz-border-radius-bottomright:9px;
    -webkit-border-bottom-right-radius:9px;
    border-bottom-right-radius:9px;
}

.tablee table tr:first-child td:first-child {
    -moz-border-radius-topleft:9px;
    -webkit-border-top-left-radius:9px;
    border-top-left-radius:9px;
}

.tablee table tr:first-child td:last-child {
    -moz-border-radius-topright:9px;
    -webkit-border-top-right-radius:9px;
    border-top-right-radius:9px;
}

.tablee tr:last-child td:first-child {
    -moz-border-radius-bottomleft:9px;
    -webkit-border-bottom-left-radius:9px;
    border-bottom-left-radius:9px;
}

.tablee tr:hover td {
    background-color:#82c0ff;
    background:-o-linear-gradient(bottom, #82c0ff 5%, #56aaff 100%);    background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #82c0ff), color-stop(1, #56aaff) );
    background:-moz-linear-gradient( center top, #82c0ff 5%, #56aaff 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#82c0ff", endColorstr="#56aaff");  background: -o-linear-gradient(top,#82c0ff,56aaff);
}

.tablee tr:first-child td {
    background:-o-linear-gradient(bottom, #0069d3 5%, #007fff 100%);    background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #0069d3), color-stop(1, #007fff) );
    background:-moz-linear-gradient( center top, #0069d3 5%, #007fff 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0069d3", endColorstr="#007fff");  background: -o-linear-gradient(top,#0069d3,007fff);
    background-color:#0069d3;
    border:0px solid #000000;
    text-align:center;
    border-width:0px 0px 1px 1px;
    font-size:18px;
    font-family:Comic Sans MS;
    font-weight:bold;
    color:#ffffff;
}

.tablee tr:first-child:hover td {
    background:-o-linear-gradient(bottom, #0069d3 5%, #007fff 100%);    background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #0069d3), color-stop(1, #007fff) );
    background:-moz-linear-gradient( center top, #0069d3 5%, #007fff 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0069d3", endColorstr="#007fff");  background: -o-linear-gradient(top,#0069d3,007fff);
    background-color:#0069d3;
}

.tablee tr:first-child td:first-child {
    border-width:0px 0px 1px 0px;
}

.tablee tr:first-child td:last-child {
    border-width:0px 0px 1px 1px;
}

.tablee td {
    background:-o-linear-gradient(bottom, #56aaff 5%, #82c0ff 100%);    background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #56aaff), color-stop(1, #82c0ff) ); 
    background:-moz-linear-gradient( center top, #56aaff 5%, #82c0ff 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#56aaff", endColorstr="#82c0ff");  background: -o-linear-gradient(top,#56aaff,82c0ff);
    background-color:#56aaff;
    border:1px solid #000000;
    border-width:0px 1px 1px 0px;
    text-align:left;
    padding:7px;
    font-size:12px;
    font-family:Comic Sans MS;
    font-weight:bold;
    color:#000000;
}

.tablee tr:last-child td {
    border-width:0px 1px 0px 0px;
}

.tablee tr td:last-child {
    border-width:0px 0px 1px 0px;
}

.tablee tr:last-child td:last-child {
    border-width:0px 0px 0px 0px;
}
//table with data
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['position'] . "</td>";
echo "<td>" . $row['unit'] . "</td>";
echo "<td>" . $row['department'] . "</td>";
echo "<td>" . $row['telefon'] . "</td>";
echo "<td>" . $row['faks'] . "</td>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['data'] . "</td>";
echo "<td>" . $row['reason'] . "</td>";
echo "</tr>";  // Add this in
}