【发布时间】:2013-12-05 22:47:31
【问题描述】:
我刚刚从 PHPmyadmin 中找到了如何显示我的表格,但我希望第五行有一个虚线轮廓。我知道如何在 CSS“border-style:dashed;”中制作虚线边框。问题是我的代码如何从数据库中调用我的数据并将其放入 HTML 表中,我是否需要重新编码以使第五行变为虚线?
// Get all the data from the "epl" table
$result = mysql_query("SELECT * FROM epl")
or die(mysql_error());
echo "<table border='1'>";
echo "<tr> <th>Pos</th> <th>Team</th> <th>PLD</th> <th>W</th> <th>D</th>
<th>L</th> <th>F</th> <th>A</th> <th>GD</th> <th>PTS</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['Pos'];
echo "</td><td>";
echo $row['Team'];
echo "</td><td>";
echo $row['PLD'];
echo "</td><td>";
echo $row['W'];
echo "</td><td>";
echo $row['D'];
echo "</td><td>";
echo $row['L'];
echo "</td><td>";
echo $row['F'];
echo "</td><td>";
echo $row['A'];
echo "</td><td>";
echo $row['GD'];
echo "</td><td>";
echo $row['PTS'];
echo "</td></tr>";
}
我正在尝试做的一个例子是'http://www.bbc.co.uk/sport/football/tables'
【问题讨论】: