【发布时间】:2018-03-29 01:15:12
【问题描述】:
我在多个页面中有回显表标签,我想通过为回显 tr 标签提供一个类来设置表的 tr 标签样式,并在我的 css 文件中定义该类的 css。我怎样才能做到这一点?我的查看页面代码在这里:
<html>
<head>
<title>View Records</title>
</head>
<body>
<?php
include('connection.php');
$count=1;
$result=@mysql_query("SELECT * FROM form")
or die(mysql_error());
echo "<table border='1' cellpadding='10'>";
echo "<tr> <th>ID</th> <th>First Name</th> <th>Last Name</th> <th>Password</th> <th>Email</th> <th>Contact Number</th><th>Edit</th><th>Delete</th></tr>";
while ($row=mysql_fetch_array($result)) {?>
<tr>
<td align="center"><?php echo $row["id"]; ?></td>
<td align="center"><?php echo $row["fname"]; ?></td>
<td align="center"><?php echo $row["lname"]; ?></td>
<td align="center"><?php echo $row["pwd"]; ?></td>
<td align="center"><?php echo $row["eml"]; ?></td>
<td align="center"><?php echo $row["num"]; ?></td>
<td align="center"><a href="editrecord.php?id=<?php echo $row["id"]; ?>">Edit</a></td>
<td align="center"><a href="delete.php?id=<?php echo $row["id"]; ?>">Delete</a></td>
</tr>
<?php $count++; } ?>
}
</table>";
?>
<p><a href="index.php">Add a new Record</a></p>
</body>
</html>
【问题讨论】:
-
这个问题的状态如何?有人好心在下面发布了答案,但您甚至没有在它下面发表评论或接受答案。那么,你说什么?
标签: html forms html-table echo