Jump to content

[SOLVED] Text not taking up all of Table Column


ArizonaJohn

Recommended Posts

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;
      }

 

 

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.

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.