تغییر در قسمتی از کد

ameen

کاربر عضو
سلام.

دوستام من کدی دارم که برترین کاربران وب سایتمو نشون میده و جلوشون امتیازشونو نشون میده.

فقط این که یکم بهم ریختست

تو عکس ضمیمه شده هم گذاشتم گفتم چجوریه و میخوام که چجوری باشه.

مرسی

این کده منه


کد:
</thead>
    <tbody>
<div style="border-radius:3px;margin-top:10px;padding:10px;text-align:left;background:#D9EDF7;border: 1px solid #BCE8F1;color:#31708F;font-size:14px;"><center><i class="fa fa-flag-checkered"></i> 10 بازی کن برتر (تعداد برد) </center>
<?php
$sql = mysql_query("SELECT * FROM users ORDER BY wins DESC LIMIT 10");
while ($row = mysql_fetch_assoc($sql)) {
    echo '
      ' . $i . '
      </td>
      <td><br>
      <b>' . $row['username'] . '</b></a>
             <td style="text-align:center;"><b>' . $row['wins'] . '</b></td>
      </td>
    </tr>
';
}
?>
    </tbody>
  </table>
    </div>
You must be registered for see images attach


 

mahdyar7

تازه وارد
سلام

راه اول - کدهای زیر رو جایگزین کدهای قبل کنید :


کد:
[COLOR=#000000][FONT=monospace]</thead>[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace]    <tbody>[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace]<div style="border-radius:3px;margin-top:10px;padding:[/FONT][/COLOR][FONT=Consolas]10px[/FONT][FONT=Consolas]10px [/FONT][FONT=Consolas]25px[/FONT][COLOR=#000000][FONT=monospace];text-align:left;background:#D9EDF7;border: 1px solid #BCE8F1;color:#31708F;font-size:14px;"><center><i class="fa fa-flag-checkered"></i> 10 بازی کن برتر (تعداد برد) </center>[/FONT][/COLOR]
[COLOR=#0000BB][FONT=monospace]<?php
$sql [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]mysql_query[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"SELECT * FROM users ORDER BY wins DESC LIMIT 10"[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);
while ([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$row [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]mysql_fetch_assoc[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$sql[/FONT][/COLOR][COLOR=#007700][FONT=monospace])) {
    echo [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'
      ' [/FONT][/COLOR][COLOR=#007700][FONT=monospace]. [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$i [/FONT][/COLOR][COLOR=#007700][FONT=monospace]. [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'
      </td>
      <td><br>
      <b [/FONT][/COLOR][FONT=Consolas]class[/FONT][FONT=Consolas]="[/FONT][FONT=Consolas]name[/FONT][FONT=Consolas]"[/FONT][COLOR=#DD0000][FONT=monospace]>' [/FONT][/COLOR][COLOR=#007700][FONT=monospace]. [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$row[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'username'[/FONT][/COLOR][COLOR=#007700][FONT=monospace]] . [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'</b></a>[/FONT][/COLOR]
[COLOR=#DD0000][FONT=monospace]<td style="text-align:center;"><b [/FONT][/COLOR][FONT=Consolas]class[/FONT][FONT=Consolas]="[/FONT][FONT=Consolas]rate[/FONT][FONT=Consolas]"[/FONT][COLOR=#DD0000][FONT=monospace]>' [/FONT][/COLOR][COLOR=#007700][FONT=monospace]. [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$row[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'wins'[/FONT][/COLOR][COLOR=#007700][FONT=monospace]] . [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'</b></td>[/FONT][/COLOR]
[COLOR=#DD0000][FONT=monospace]      </td>
    </tr>
'[/FONT][/COLOR][COLOR=#007700][FONT=monospace];
}
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>
[/FONT][/COLOR][COLOR=#000000][FONT=monospace]    </tbody>[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace]  </table>[/FONT][/COLOR]

[COLOR=#000000][FONT=monospace]    </div>[/FONT][/COLOR]
و به فایل style.css کدهای زیر را اضافه کنید :


کد:
[COLOR=#888888][FONT=Consolas][COLOR=#222222]b.name[/COLOR][/FONT][/COLOR][FONT=Consolas] {[/FONT][COLOR=#C80000]float[/COLOR]: left;}[FONT=Consolas]
[/FONT][FONT=Consolas][COLOR=#888888][COLOR=#222222]b.rate[/COLOR][/COLOR] {[/FONT][COLOR=#C80000]float[/COLOR]: right;[FONT=Consolas]}[/FONT]
راه دوم - در همون کدی که خودتون گذاشتید text-align:left; رو پاک کنید که البته نحوه نمایش یک مقدار متفاوت خواهد بود.

تصویر 1 روش اول و تصویر 2 روش دوم

موفق باشید...

attachment.php


attachment.php


You must be registered for see images attach


You must be registered for see images attach


 
بالا