
05-11-2009, 22:55
|
|
|
|
חבר מתאריך: 17.10.05
הודעות: 161
|
|
|
מיקום div באמצע הדף
שלום לכולם.
כתבתי קוד ששולף מטבלה שדה טקסט שמכיל מילות מפתח הקוד למעשה עובר שורה שורה מוציא את המילה וכותב אותה לדף.
הבעייה היא שיש לי בדף <div> ואני רוצה שהפלט יכתב מסביב ל<div>,כלומר ה-div יהיה באמצע לדוגמה:
************************************************** ************************
************************************************** ************************
************************************************** ************************
**********************1111111111111111111********* ****************
**********************1111111111111111111********* ****************
**********************1111111111111111111********* ****************
**********************1111111111111111111********* ****************
**********************1111111111111111111********* ****************
**********************1111111111111111111********* ****************
************************************************** ***********************
************************************************** ***********************
************************************************** ************************
הספרה 1 מייצגת את ה-<div>
יש רעיונות?
זהו קוד html:
קוד:
<table border=0 style="width:700px;vertical-align:top;" cellpadding=2 cellspacing=0 align=center>
<tr>
<td >
<img src="../sms4u/lo.gif" alt="לוגו">
</td>
</tr>
<tr>
<td align=right>
<div id="divp" style="width:250px;height:250px;position:relative;left:50 px;top:50px;border: 1px solid #26679E;" >בלה בלה בלה?</div>
<?php
function fontcolor()
{
$color[0]="0F6E2A";
$color[1]="9BB27C";
$color[2]="82C52A";
$ens=(rand(0,2));
return $color[$ens];
}
function fontsize()
{
$ens=(rand(14,24));
return $ens;
}
$con= mysql_connect(******,*****,'******');
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("********", $con);
$encoding = 'utf-8';
mb_detect_order($encoding);
mb_internal_encoding($encoding);
mysql_query("SET NAMES utf8;");
$result=mysql_query("SELECT text,id FROM table1");
while($row = mysql_fetch_array($result))
{
echo '<a id='.$row['id'].' style="COLOR:#' .fontcolor(). ';FONT-SIZE:' .fontsize(). 'px;" onClick="ajaxFunction(this.id)">'.$row['text'].'</a>';
echo " ";
}
mysql_close($con);
?>
</td>
</tr>
</table>
|