【发布时间】:2013-09-09 10:42:18
【问题描述】:
我需要冻结下表的第一行,下面是我当前的代码 如果您需要更多信息,请告诉我
这是一张桌子的图片:
<head>
<style>
table,td,th
{border-collapse:collapse;}
table.myTable td, table.myTable th { border:1px solid black;padding:5px;
font-family:Verdana, Arial, Helvetica, sans-serif;
color:#2C3539;
font-size:0.80em}
table
{width:100%;}
th{background-color:#B6B6B4;
height:10px;}
</style>
<table class="myTable">
<?php
//MySQL Database Connect
include 'connect.php';
echo "
<tr>
<th>Name</th>
<th>Location</th>
<th>Email</th>
<th>Mobile</th>
<th>IMEI</th>
<th>Phone</th>
<th>Message</th>
</tr></Freezing>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Name'] . "</td>";
echo "<td>" . $row['Location'] . "</td>";
echo "<td>" . $row['Email'] . "</td>";
echo "<td>" . $row['Mobile'] . "</td>";
echo "<td>" . $row['IMEI'] . "</td>";
echo "<td>" . $row['Phone'] . "</td>";
echo "<td>" . $row['Message'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
【问题讨论】:
-
“我需要冻结下表的第一行” – 你需要详细说明。
-
i.stack.imgur.com/NzJKZ.png - 此图像将显示表格,灰色背景将是我需要冻结的行,如果这有意义的话
-
我看到了图片,我只是不明白你想要达到什么目的。
-
你的意思是让它“固定”,这样它就不会移动了?
-
看看这个fixedheadertable.com 和datatables.net/extras/fixedheader 还有谷歌“固定标题表”。你应该可以找到很多选择。
标签: php css html-table