0

Hi
I had to echo a table from a database in a html column (td) but the problem is the width of that column is increasing when show that para.... Please help me...
Thanks
Rajeesh

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by ashafaaiz
0

Would you care to be a little more specific? The width of what column is increasing? And why is this a problem? HTML tables will fit to the largest width by default.

0

Hi,
What exactly you want? Just display all the fields of table in the html table? You wont bother about the width rather you should give border="0" in the table. for eg:- if you have two fields as Name,Age in "person" table, then

// made database connections in php
  //$sql=mysql_query("select * from person");
   <form>
   <table border="0">
    <tr>
    <td>Name</td><td>Age</td>
     <?
     while($row=mysql_fetch_array($sql))
     {
     ?>
      <td> <? echo $row['Name'];?></td>
      <td><?echo $row['Age'];?></td>
     <?
         }
     ?>
    </table>
   </form>

It automatically displays all Name and Age in person.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.