izbryte Posted November 16, 2007 Share Posted November 16, 2007 I have a table that is supposed to be only 400 pixels wide where I'm posting some articles that are pulled out of a mysql database using PHP. Sometimes the articles will contain a really long URL and it pushes the width of my table column so that it's larger than 400 pixels. Is there a way I can control the size of the URL or force it to break and continue on the next line? Quote Link to comment Share on other sites More sharing options...
only one Posted November 16, 2007 Share Posted November 16, 2007 Your table should stick to the width it's set to, try using divs instead of tables. Check the substr manual. Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 16, 2007 Share Posted November 16, 2007 Try locking down your table cell data with <td width="400"> Text should then automatically flow down without blowing out the cell. You might also consider using a replace function to shorten or remove full URLs. Example: raw URL: http://somesubdomain.someactualdomain.com/a_file_path/file_path_2/theActualFile.php converted: <a href="http://somesubdomain.someactualdomain.com/a_file_path/file_path_2/theActualFile.php">http://somesubdomain.someact...</a> // only http://somesubdomain.someact... will print to the table, anchored with a hyperlink or <a href="http://somesubdomain.someactualdomain.com/a_file_path/file_path_2/theActualFile.php">Short Link Description</a> PhREEEk Quote Link to comment Share on other sites More sharing options...
izbryte Posted November 30, 2007 Author Share Posted November 30, 2007 Ok, but is it possible to shorten just the URL that's in the article? I've tried using the exact width but it's still not working. You can see what I mean here. Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 30, 2007 Share Posted November 30, 2007 You should use the second example I gave. Here's your proposed news article: Gehry, Skanska Point Fingers Over MIT Lawsuit The suit, filed on October 31 at Suffolk Superior Court, in Boston, claims that “Gehry and Skanska committed design and construction failures on the project which caused, among other things, masonry cracking, efflorescence, and poor drainage at (Stata Center’s) outdoor amphitheater; efflorescence and mold growth at various locations on the brick exterior vertical elevations; Full Article by Sam Lubell... <td align="left" width="190" valign="middle"> <b>Gehry, Skanska Point Fingers Over MIT Lawsuit</b> <br> The suit, filed on October 31 at Suffolk Superior Court, in Boston, claims that “Gehry and Skanska committed design and construction failures on the project which caused, among other things, masonry cracking, efflorescence, and poor drainage at (Stata Center’s) outdoor amphitheater; efflorescence and mold growth at various locations on the brick exterior vertical elevations; <a href="http://archrecord.construction.com/news/daily/archives/071114gehry.asp" target="_blank">Full Article</a> by Sam Lubell <br> <div align="right"> <a href="http://arkitectum.com/architect-jobs-forum/viewtopic.php?t=64" target="_self" class="small_grn_10">read more...</a> </div> <hr align="center" size="1" noshade color="#B1C3D9"> </td> PhREEEK Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.