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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.