Stephen68 Posted February 25, 2009 Share Posted February 25, 2009 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 More sharing options...
JonnoTheDev Posted February 25, 2009 Share Posted February 25, 2009 If the text contains no spaces or line breaks it will push the cell out Link to comment https://forums.phpfreaks.com/topic/146824-table-help/#findComment-770880 Share on other sites More sharing options...
Stephen68 Posted February 25, 2009 Author Share Posted February 25, 2009 So how would I stop it from doing that? Link to comment https://forums.phpfreaks.com/topic/146824-table-help/#findComment-771007 Share on other sites More sharing options...
JonnoTheDev Posted February 25, 2009 Share Posted February 25, 2009 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 More sharing options...
Stephen68 Posted February 25, 2009 Author Share Posted February 25, 2009 Ok thanks man, I'll head over to the PHP help area now. Again thank for you time and help Stephen Link to comment https://forums.phpfreaks.com/topic/146824-table-help/#findComment-771041 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.