Jump to content

Table help


Stephen68

Recommended Posts

Ok I have a table the is filled out with PHP and mysql. I set the table width but the table still seems to grow

and shrink. I'm not really sure why, shouldn't the cells not become larger then the table width I gave it?

 


<table border="1" width="730" cellpadding="3" cellspacing="0">
<tr>
   <td valign="top" class="tableheading">Posting #</td>
   <td valign="top" class="tableheading">Employer</td>
   <td valign="top" class="tableheading">Position</td>
   <td valign="top" class="tableheading">Cover Letter to</td>
   <td valign="top" class="tableheading">Date Posted</td>
   <td valign="top" class="tableheading">Date Closed</td>
   <td valign="top" class="tableheading">Applicants</td>
   <td valign="top" class="tableheading"># Apps</td>
   <td valign="top" class="tableheading">Status</td>
   <td valign="top" class="tableheading">Posting Status</td>
</tr>    

<tr onclick="location.href='formView.php?j=3084';" onMouseOver="this.bgColor = '#C0C0C0'" onMouseOut ="this.bgColor = '#FFFFFF'" bgcolor="#FFFFFF">

    <td valign="top" class="main"><font color="blue"> </font></td>
    <td valign="top" class="main"> Fisheries and Oceans Canada</td>
    <td valign="top" class="main">Research assistant</td>
    <td valign="top" class="main">Anaïs Lacoursière-Roussel</td>     
    <td valign="top" class="main"> </td>  
    <td valign="top" class="main"></td>         
    <td valign="top" class="main"> </td>
    <td valign="top" class="main"> </td>
    <td valign="top" class="main"> </td>
    <td valign="top" class="main">To be Approved</td>
</tr>

</table>

 

 

This is what one row of the table out put looks like, any help would be great

Stephen

Link to comment
https://forums.phpfreaks.com/topic/146824-table-help/
Share on other sites

You could use a text wrap function in php or substring the text.

 

i.e. If I have a string of text:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbcccccccccccccccccc

 

This is obviously going to push the cell width no matter what you set it to. If however I use a wrap function I could end up with a string like

 

aaaaaaaaaaaaaaaaaaaaa

aaaaaaaaaaaaaaaaaabbb

bbbbbbbcccccccccccccc

 

etc, that will fit

 

Link to comment
https://forums.phpfreaks.com/topic/146824-table-help/#findComment-771015
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.