Помощ за редакция на php файл.

to0ken1

Registered
Някой ще може ли да ми помогне да сложа една линия под "Nick" и "Kills" (след първия ред). Опитах се с <hr>, но нещо не се получаваше искам да мога да сменям и дебелината на линията...
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Статистика</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<style>
html,body { background: black ;}
</style>
</head>
<body>
<div style="margin 0 auto; width: 500px; ">
<?php
$host = "";
$user = "";
$pass = "";
$db = "";
$connect = mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($db, $connect) or die(mysql_error());
$sql = "SELECT * FROM `simple_rank` ORDER by kills DESC LIMIT 0,20";
$result = mysql_query($sql) or die(mysql_error());
echo "<table style=\"border: 2px solid white;\"><tr><td><b style=\"color: blue;\">Nick</b></td><td><b style=\"color: red;\">Kills</b></td>"; while($row = mysql_fetch_assoc($result)) { 
echo "<tr><td><span style=\"color: blue\">".$row[nick]."</span></td><td><span style=\"color: red\">".$row[kills]."</span></td></tr></table>";}

?>
</div>
</body>
</html>
 
PHP:
cho "<table style=\"border: 2px solid white;\"><tr><td><b style=\"color: blue;\">Nick</b><hr/></td><td><b style=\"color: red;\">Kills</b> <hr/></td>"; while($row = mysql_fetch_assoc($result)) {
Самоче ефекта от тая таблица не знам как ще дойде
 
tedo96 каза:
<hr style="height: 10px;">

А къде точно ще се постави? Препоръчвам ти да я сложиш и да дадеш кода в новия вид, вместо да се мъчиш да ми обесниш . :D :)
 
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Статистика</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<style>
html,body { background: black ;}
</style>
</head>
<body>
<div style="margin 0 auto; width: 500px; ">
<?php
$host = "";
$user = "";
$pass = "";
$db = "";
$connect = mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($db, $connect) or die(mysql_error());
$sql = "SELECT * FROM `simple_rank` ORDER by kills DESC LIMIT 0,20";
$result = mysql_query($sql) or die(mysql_error());
echo "<table style=\"border: 2px solid white;\"><tr><td><b style=\"color: blue;\">Nick</b></td><td><b style=\"color: red;\">Kills</b><hr style="height: 10px;"></td>"; while($row = mysql_fetch_assoc($result)) { 
echo "<tr><td><span style=\"color: blue\">".$row[nick]."</span></td><td><span style=\"color: red\">".$row[kills]."</span></td></tr></table>";}

?>
</div>
</body>
</html>
 
Показва грешка опитах се да я направа и аз така... Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in пътя до файла on line 22
 
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Статистика</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<style>
html,body { background: black ;}
</style>
</head>
<body>
<div style="margin 0 auto; width: 500px; ">
<?php
$host = "";
$user = "";
$pass = "";
$db = "";
$connect = mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($db, $connect) or die(mysql_error());
$sql = "SELECT * FROM `simple_rank` ORDER by kills DESC LIMIT 0,20";
$result = mysql_query($sql) or die(mysql_error());
echo "<table style=\"border: 2px solid white;\"><tr><td><b style=\"color: blue;\">Nick</b></td><td><b style=\"color: red;\">Kills</b><hr style=\"height: 10px;\"></td>"; while($row = mysql_fetch_assoc($result)) { 
echo "<tr><td><span style=\"color: blue\">".$row[nick]."</span></td><td><span style=\"color: red\">".$row[kills]."</span></td></tr></table>";}

?>
</div>
</body>
</html>
 
Направих една малка промяна на кода </table>, че не беше както трябва! Показва ми линия обаче не е по цялото искам да кажа: от Nick до Kills... Ето ти снимка
3042882v.jpg
На 2 то очертах линията с зелен цвят да видиш от къде до къде искам да е...


PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Статистика</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<style>
html,body { background: black ;}
</style>
</head>
<body>
<div style="margin 0 auto; width: 500px; ">
<?php
$host = "";
$user = "";
$pass = "";
$db = "";
$connect = mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($db, $connect) or die(mysql_error());
$sql = "SELECT * FROM `simple_rank` ORDER by kills DESC LIMIT 0,20";
$result = mysql_query($sql) or die(mysql_error());
echo "<table style=\"border: 2px solid white;\"><tr><td><b style=\"color: blue;\">Nick</b></td><td><b style=\"color: red;\">Kills</b><hr style=\"height: 10px;\"></td>"; while($row = mysql_fetch_assoc($result)) { 
echo "<tr><td><span style=\"color: blue\">".$row[nick]."</span></td><td><span style=\"color: red\">".$row[kills]."</span></td></tr>";}
echo "</table>"

?>
</div>
</body>
</html>
 
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Статистика</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<style>
html,body { background: black ;}
</style>
</head>
<body>
<div style="margin 0 auto; width: 500px; ">
<?php
$host = "";
$user = "";
$pass = "";
$db = "";
$connect = mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($db, $connect) or die(mysql_error());
$sql = "SELECT * FROM `simple_rank` ORDER by kills DESC LIMIT 0,20";
$result = mysql_query($sql) or die(mysql_error());
echo "<table style=\"border: 2px solid white;\"><tr><td><b style=\"color: blue;\">Nick</b></td><td><b style=\"color: red;\">Kills</b></td><hr style=\"height: 10px;\">"; while($row = mysql_fetch_assoc($result)) { 
echo "<tr><td><span style=\"color: blue\">".$row[nick]."</span></td><td><span style=\"color: red\">".$row[kills]."</span></td></tr>";}
echo "</table>"

?>
</div>
</body>
</html>
 
Не стана показва го обаче отгоре над таблицата! Пробвах да го сложа и пред Nick пак отгоре показва...
 
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Статистика</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<style>
html,body { background: black ;}
</style>
</head>
<body>
<div style="margin 0 auto; width: 500px; ">
<?php
$host = "";
$user = "";
$pass = "";
$db = "";
$connect = mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($db, $connect) or die(mysql_error());
$sql = "SELECT * FROM `simple_rank` ORDER by kills DESC LIMIT 0,20";
$result = mysql_query($sql) or die(mysql_error());
echo "<table style=\"border: 2px solid white;\"><tr><td><b style=\"color: blue;\">Nick</b></td><td><b style=\"color: red;\">Kills</b></td>"; while($row = mysql_fetch_assoc($result)) { 
echo "<tr><td><span style=\"color: blue\">".$row[nick]."</span></td><td><span style=\"color: red\">".$row[kills]."</span></td></tr><hr style=\"height: 10px;\">";}
echo "</table>"

?>
</div>
</body>
</html>

или:
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Статистика</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<style>
html,body { background: black ;}
</style>
</head>
<body>
<div style="margin 0 auto; width: 500px; ">
<?php
$host = "";
$user = "";
$pass = "";
$db = "";
$connect = mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($db, $connect) or die(mysql_error());
$sql = "SELECT * FROM `simple_rank` ORDER by kills DESC LIMIT 0,20";
$result = mysql_query($sql) or die(mysql_error());
echo "<table style=\"border: 2px solid white;\"><tr><td><b style=\"color: blue;\">Nick</b></td><td><b style=\"color: red;\">Kills</b></td>"; while($row = mysql_fetch_assoc($result)) { 
echo "<tr><td><span style=\"color: blue\">".$row[nick]."</span></td><td><span style=\"color: red\">".$row[kills]."</span></td></tr>";}
echo "</table><hr style=\"height: 10px;\">"

?>
</div>
</body>
</html>
 
С 2-я код линията излезна най отдоло, а с първия излезнаха много линии обаче бяха най отгоре... Няма ли някакъв друг начин, само с този код ли може ?
 
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Статистика</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<style>
html,body { background: black ;}
</style>
</head>
<body>
<div style="margin 0 auto; width: 500px; ">
<?php
$host = "";
$user = "";
$pass = "";
$db = "";
$connect = mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($db, $connect) or die(mysql_error());
$sql = "SELECT * FROM `simple_rank` ORDER by kills DESC LIMIT 0,20";
$result = mysql_query($sql) or die(mysql_error());
echo "<table style=\"border: 2px solid white;\"><tr><td><b style=\"color: blue;\">Nick</b><hr style=\"height: 2px; color: #5b1b91;\"></td><td><b style=\"color: red;\">Kills</b><hr style=\"height: 2px; color: #5b1b91si ;\"></td>"; 
while($row = mysql_fetch_assoc($result)) { 
echo "<tr><td><span style=\"color: blue\">".$row[nick]."</span></td><td><span style=\"color: red\">".$row[kills]."</span></td></tr>";}
echo "</table>";

?>
</div>
</body>
</html>
 

Back
Горе