0

Dear Guys,

i have Created a Table using Php and when i inters much data on it (Address or History of some subjects), it will make the table toooo large in size which's unneeded .. i need to manage the width of my table eeven if i enter lots of data on it i want it to be line by line not to resize my table and makes it ugly and missed up.


mch luvv
an intern

4
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by metalix
0

I think you are talking about HTML table.
You can fix the width of table.
You need to post your code for review.
PLEASE USE CODE TAGS.

0

<table width=500px>
<tr>
<td width=10%>1 </td>
<td width=40%>2 </td>
<td width=40%>3 </td>
</tr>

<tr>
<td >4 </td>
<td >5 </td>
<td >6 </td>
</tr>

<tr>
<td >7 </td>
<td >8 </td>
<td >9 </td>
</tr>
</table>

0
echo "<tr><td width=300><b>&nbsp;&nbsp;Cotegory</b></td><td >&nbsp;&nbsp;" .  $row [0] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp;Company name</b></td><td >&nbsp;&nbsp;" .  $row [1] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp;CEO</b></td><td >&nbsp;&nbsp;" .  $row [2] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp;Public Relations</b></td><td >&nbsp;&nbsp;" .  $row [3] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp;Ownership</b></td><td >&nbsp;&nbsp;" .  $row [4] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp;Field of Operation </b></td><td >&nbsp;&nbsp;" .  $row [5] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp; Budget Of CSR </b></td><td >&nbsp;&nbsp;" .  $row [6] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp;Portable Awards</b></td><td >&nbsp;&nbsp;" .  $row [7] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp;Countries of Operation</b></td><td  >&nbsp;&nbsp;" .  $row [8] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp; History  Of Donation in Health Care </b></td><td >&nbsp;&nbsp;" .  $row [9] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp;Year of Operation </b></td><td >&nbsp;&nbsp;" .  $row [10] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp;Realtionship With WHO </b></td><td >&nbsp;&nbsp;" .  $row [11] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp;Relationship With Universities </b></td><td >&nbsp;&nbsp;" .  $row [12] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp;Realtionship With Charitable Organizations </b></td><td >&nbsp;&nbsp;" .  $row [13] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp; Telephone No  </b></td><td >&nbsp;&nbsp;" .  $row [14] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp; Fax No </b></td><td >&nbsp;&nbsp;" .  $row [15] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp; Email Address  </b></td><td >&nbsp;&nbsp;" .  $row [16] ."</td></tr>"."<tr><td><b>&nbsp;&nbsp; Postal Address </b></td><td >&nbsp;&nbsp;" .  $row [17] ."</td></tr>";



  echo "</tr>";
  }

echo "</table>";

// the data wil be out from the database and fill up the space front of Address ... and History then if the information are too much words the table wil got right side but what's i want is the data can be within the table in more than 1 line better than what's going on now.
i know u all got what i mean !
// the space of history and postal address is where i want it not to be resized when i enter data into it .. any idea ?

Edited by monta2020: n/a

1
<tr><td><b>&nbsp;&nbsp; History  Of Donation in Health Care </b></td><td width=300px>&nbsp;&nbsp;" .  $row [9] ."</td></tr>

<tr><td><b>&nbsp;&nbsp; Postal Address </b></td><td width=300px>&nbsp;&nbsp;" .  $row [17] ."</td></tr>

I have written <td width=300px> in value part (2nd column of table). So maximum column width will be 300. do not set width in another row values. You may adjust width according to your data string length of history or postal which ever is bigger

Votes + Comments
MY DEAR I DON"T KNOW HOW TO THANK U !! I LOVE U MAN :) :) it works out
0

Make sure you set all the width tags to be correct.
else you can use styles
td {
width:300px;
}

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.