虚线未显示HTML、PHP、MySql


Dashed line not showing HTML, PHP, MySql

我有一个数据库,它正在输出一个特定的行。我的代码可以做到这一点,但我希望在它周围有一个虚线边框作为我的表。下面的代码应该在这一行周围画一条虚线,但我不知道为什么它不起作用。有人能帮忙吗?

$count = 1
echo "<table>";
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 )) {
if($count == 5) {
 echo "<tr style='border-style:dashed'><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>"; 
 }
 else {
  echo "<tr><td>"; 
 }

不允许的直接样式。您应该在元素上设置边框,并使用border-right和border-left来删除列之间的边框。

<tr>
  <td style="border: 1px dashed black; border-right: none">Left</td>
  <td style="border: 1px dashed black; border-left: none; border-right: none">Middle</td>
  <td style="border: 1px dashed black; border-left: none; border-right: none">Middle</td>
  <td style="border: 1px dashed black; border-left: none">Right</td>
</tr>

不过,您确实应该使用html类和CSS文件。