Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

the table change it when i add a dynamic code with PHP

OK

I have this page: http://www.sitemx.mx/studies.php.

The main data of this page is loaded from another page using ckeditor. This content is saved in a database and when studies.php is loaded the content is loaded from the database.

One of the part of the site, is the glossary of terms. (this terms are saved in a database).
My user wants that when studies.php is loaded the page make a dynamic links when a word of studies.php matches with the data saved on the glossary.

The problem is when the page do the dynamics links
THIS CODE:  
$temporal = '<a onclick="abrir(\'terms.php?recordID='.$row['clave'].'\',\'279\',\'701\',2,\''.$row['clave'].'_terms\')" href="#">'.$palabras[$i].'</a>';			$imprime = $imprime. " ".$temporal;

Open in new window

.

The format of the page change a lot, for example: http://www.sitemx.mx/test1.php.

I think the problem is on the last part of the code, because this table when the page do dynamic links is printed onside the main table, when his real position is outside the main table.
 
echo '<table border="0" width="950" cellspacing="0" cellpadding="0" id="table714">';
             echo ' <tr>';
             echo '  <td width="475">';
             echo '   <font class="menu_titulo"><br></font>';
             echo '  </td>';
             echo '  <td width="475" align="right">';
             echo '   <font class="menu_titulo"><br>';
             echo '      ';
             echo '   </font>';
             echo '  </td>';
             echo ' </tr>';
             echo '</table>';

Open in new window

.

This is the code all the code where I check is there is a match with the words on the glossary:
 code1.txt


If you need this is the all code of studies.php
 page.txt
0
altariamx2003
Asked:
altariamx2003
  • 3
  • 2
3 Solutions
 
fcontrepoisCommented:
Check the <div align="center"> is present in your php version of the file

prefer the use of <div style="margin-right:auto; margin-left:auto;" > to center things
0
 
Ray PaseurCommented:
OK, what is the question?
0
 
altariamx2003Author Commented:
Hi Ray

Why when the page add the dynamic links the format of table change it???

this is the link that I add for this issue (exampe: http://www.sitemx.mx/test1.php
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
altariamx2003Author Commented:
hi fcontrepois

at the end of the page I add this code:
 
echo '<table border="0" width="950" cellspacing="0" cellpadding="0" id="table714">';
             echo ' <tr>';
             echo '  <td width="475">';
             echo '   <font class="menu_titulo"><br></font>';
             echo '  </td>';
             echo '  <td width="475" align="right">';
             echo '   <font class="menu_titulo"><br>';
             echo '      ';
             echo '   </font>';
             echo '  </td>';
             echo ' </tr>';
             echo '</table>';

Open in new window


If I remove this code this is how the page looks: http://www.sitemx.mx/test2.php

As you can see  the format looks fine and everything works great

I would like to know why no matter what kind of table I add add the end of the page the format change.

0
 
Ray PaseurCommented:
Check these links to the W3C validation service.  If you have valid HTML, you will be using more CSS and you will probably be able to avoid unexpected changes in width.  What is probably happening is that a combination of an image (display-block) with an explicitly sized table is causing the display area to expand.

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.sitemx.mx%2Ftest2.php&charset=%28detect+automatically%29&doctype=Inline&group=0
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.sitemx.mx%2Ftest1.php&charset=%28detect+automatically%29&doctype=Inline&group=0

A good tool that can help you find what is causing the expansion is the Firebug plug-in for Firefox.   You can open it up and put your mouse over the HTML, and it will highlight the elements on the page that are generated by the HTML.
0
 
altariamx2003Author Commented:
Thx for your help

I found the solution by myself
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now