0
下面的代碼:根據最長元素更改tr邊界?
<?php
mysqlLogin();
$username = $_COOKIE['username'];
$sql = mysql_query("SELECT username FROM `users` WHERE username!='$username'");
if(mysql_num_rows($sql) != 0) {
echo "<table class='usertable' align='center'>";
} else {
echo "<center>No users found!</center>";
}
while($row = mysql_fetch_array($sql)){
$length = strlen($row['username']) . 'px';
echo "<tr><td style='width: '$length'; border-bottom: 1px solid #000000'><center>" . $row['username'] . "</center></td></tr>";
}
?>
我想讓bottom-border
最長username
在SQL數據庫中的長度。
好的,謝謝! – Jason