ArizonaJohn Posted June 13, 2009 Share Posted June 13, 2009 Hello, I have a table, the first column of which is 535 pixels long. However, the contents of this column (a variable called $row['site']) only displays text for about 200 pixels, and then the remaining text spills down onto the row below. The result is ugly. My code and CSS are below. How can I get the text to extend into all 535 pixels of the column? Thanks in advance, John The code for the table (just up until the first column): <?php print "<table class=\"navbar\">\n"; print "<tr>"; print "<td class='sitename'>".'<a href="http://'.$row['site'].'" class="links2">'.$row['site'].'</a>'."</td>"; My CSS: table.navbar { margin-left:100px; margin-top:30px; text-align: left; font-family: Arial, Helvetica, sans-serif ; font-weight: normal; font-size: 12px; color: #000000; width: 700px; background-color: #A7E6FE; border: 1px #FFFFFF; border-collapse: collapse; border-spacing: 4px; padding: 4px; text-decoration: none; } table.navbar td { border: 2px solid #fff; text-align: left; height: 16px; } table.navbar td a{ display: block; padding: 3px; } .sitename { width: 535px; } a.links2:link { color: #000000; text-decoration: none; text-align:left; margin-top:6px; margin-bottom:2px; margin-left:2px; padding:0px; font-family:Arial, Helvetica, sans-serif; font-size: 12px; width: 10px; height: 12px; vertical-align:middle; } a.links2:visited { color: #000000; text-decoration: none; text-align:left; margin-top:6px; margin-bottom:2px; margin-left:2px; padding:0px; font-family:Arial, Helvetica, sans-serif; font-size: 12px; width: 10px; height: 12px; vertical-align:middle; } a.links2:hover { color: #000000; text-decoration: underline; text-align:left; margin-top:6px; margin-bottom:2px; margin-left:2px; padding:0px; font-family:Arial, Helvetica, sans-serif; font-size: 12px; width: 10px; height: 12px; vertical-align:middle; } a.links2:active { color: #000000; text-align:left; margin-top:6px; margin-bottom:2px; margin-left:2px; padding:0px; font-family:Arial, Helvetica, sans-serif; font-size: 12px; width:10px; height: 12px; vertical-align:middle; } Quote Link to comment https://forums.phpfreaks.com/topic/162009-solved-text-not-taking-up-all-of-table-column/ Share on other sites More sharing options...
jcombs_31 Posted June 13, 2009 Share Posted June 13, 2009 Please post the contents of the cell. If the second string is long and with no nonbreaking space, the browser doesn't wrap correctly. This is my guess as to why it is dropping down, but you didn't show us any of the content in the cell. Quote Link to comment https://forums.phpfreaks.com/topic/162009-solved-text-not-taking-up-all-of-table-column/#findComment-854968 Share on other sites More sharing options...
ArizonaJohn Posted June 13, 2009 Author Share Posted June 13, 2009 Hello, I figured it out by searching on Google: .sitename { width: 535px; overflow:hidden; } Quote Link to comment https://forums.phpfreaks.com/topic/162009-solved-text-not-taking-up-all-of-table-column/#findComment-855190 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.