0

i'm trying to make a table with html and php code which displays dynamically data, above that i use css for this table, and when i use live mode on dreamweaver it displays perfectly the table with css but empty, but not on chrome or whatever is the web browser, and actually i try to integrate the whole html and css in a ready template. for the information this is the html code that i used:

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
<body>
<div class="background">Placez ici le contenu de  class "background"

    <center>
    <h1>VOS SOUMISSIONS</h1>
    <table width="1327" height="128" border="2" cellpadding="20" cellspacing="10">
      <tr>
        <th width="208">SENDER</th>
        <th width="258">TYPE</th>
        <th width="258">TITRE</th>
        <th width="290">AUTEUR</th>
        <th width="289">ABSTRACT</th>
        <th width="289">KEYWORDS</th>
        <th width="289">DATE</th>
        <th width="289">FICHIER</th>
      </tr>
      <?php

//On recupere les identifiants, les pseudos et les emails des utilisateurs
$result = mysql_query("SELECT * FROM manusrit where id='".$_SESSION["id"]."'");

while($row = mysql_fetch_array($result))
{

?>
      <tr>
        <td class="left"><?php echo $row['sender']; ?></td>
        <td class="left"><?php echo $row['type']; ?></td>
        <td class="left"><?php echo htmlentities($row['titre'], ENT_QUOTES, 'UTF-8'); ?></td>
        <td class="left"><?php echo htmlentities($row['auteur'], ENT_QUOTES, 'UTF-8'); ?></td>
        <td class="left"><?php echo $row['abstract']; ?></td>
        <td class="left"><?php echo $row['keywords']; ?></td>
        <td class="left"><?php echo $row['date']; ?></td>
        <td class="left"><a href=\"soumissions/".$row{'file'}."\"><?php echo $row['file']; ?></a></td>
        <td class="left"><form action="/Application/soumissions/<?php echo $row['file']; ?>" method="post">
          <input type="submit" value="Download" />
        </form></td>
        <?php

}
?>
      </tr>
    </table>
    <p>&nbsp;</p><h2><strong>LES AUTRES SOUMISSIONS</strong></h2>';
  <table width="1346" height="128" border="2" cellpadding="20" cellspacing="10">
    <tr>
         <th width="208">SENDER</th>
          <th width="258">TYPE</th>
          <th width="258">TITRE</th>
          <th width="290">AUTEUR</th>
          <th width="289">ABSTRACT</th>
          <th width="289">KEYWORDS</th>
          <th width="289">DATE</th>
          <th width="289">FICHIER</th>
           <th width="41">ETAT</th>
          <th width="84">DECISION</th>
          <th width="101">RAPPORT</th>
          <th width="120">TELECHARGER</th>
    </tr>
        <?php

//On recupere les identifiants, les pseudos et les emails des utilisateurs
$req = mysql_query("SELECT * FROM manusrit where id2='1' AND id3='".$_SESSION["id3"]."'");
while (($rows=mysql_fetch_array($req))) 
{


?>
        <tr>
         <td class="left"><?php echo $rows['sender']; ?></td>
          <td class="left"><?php echo $rows['type']; ?></a></td>
          <td class="left"><?php echo htmlentities($rows['titre'], ENT_QUOTES, 'UTF-8'); ?></td>
          <td class="left"><?php echo htmlentities($rows['auteur'], ENT_QUOTES, 'UTF-8'); ?></a></td>
          <td class="left"><?php echo $rows['abstract']; ?></td>
          <td class="left"><?php echo $rows['keywords']; ?></td>
          <td class="left"><?php echo $rows['date']; ?></td>
          <td class="left"><a href=\"soumissions/".$row{'file'}."\"><?php echo $rows['file']; ?></a></td>
          <td class="left"><?php echo $rows['etat']; ?></td>
          <td class="left"><?php echo $rows['decision']; ?></td>
          <td class="left"><form action="/Application/rapport/<?php echo $row['rapport']; ?>" method="post">
<input type="submit" value="Voir le rapport" />
</form></td>
          <td class="left"><form action="/Application/soumissions/<?php echo $rows['file']; ?>" method="post">
<input type="submit" value="Download" />
</form></td>
                 <?php

}
?>
        </tr>

      </table>
</center>
</div>
</body>
</html>

And this is the css code:

.background {
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    font-style: italic;
    color: #FFF;
    background-color: #666;
    background-repeat: repeat;
    width: 1327px;
}

Thnx for your help!

hich
  • 3
  • 1
  • I think you are asking the wrong question. Dreamweaver is an editor, Chrome is a browser. Try to identify the problem independent of the IDE that you are using. – AJ Meyghani May 19 '15 at 15:03
  • What's the cuestion? what's the error? – monxas May 19 '15 at 15:04
  • 1
    Dreameaver is probably aware of a css file existing, however there isn't a CSS file referenced in your HTML, so Chrome will never know about it – gabe3886 May 19 '15 at 15:05
  • The problem is clear, when i open the php file on chrome in my local server it displays the table without css, even if i used it.. – hich May 19 '15 at 15:09
  • @gabe3886 i used the reference in the begining of the template, it looks like this – hich May 19 '15 at 15:11
  • this is only a part of the whole template – hich May 19 '15 at 15:12
  • One thing that I have realized that Dreamweaver does is use a lot of pixel values. So if you center a table by pixels in dreamweaver, it will display different in browser. This is because the screens widths are different, and the text can be more spread out. Therefore the pixels are rendered kind of useless. – Michael Jones May 19 '15 at 15:12
  • You may also want to add a doctype seeing as though you are using `xmlns="http://www.w3.org/1999/xhtml"` - see this post: http://stackoverflow.com/questions/5838343/what-does-html-xmlns-http-www-w3-org-1999-xhtml-do – Pete May 19 '15 at 15:16

1 Answers1

1

Presuming that the html provided is your full document, you don't have the css file included. You will need to add

<link rel="stylesheet" type="text/css" href="style.css"> 

before the end of the head tag. Also the href attribute must be whatever your css file is actually named.

pj100
  • 402
  • 3
  • 13