Jump to content

vertical-align='top' ignored in table


sdowney1

Recommended Posts

vertical-align='top' ignored in table

vertical-align:top is also ignored

it does respond to width and also does respond to align

I put some data in a table with 2 columns

when ever the second column overruns the width so the text wraps, the first column text centers in the table cell.

I want it to pin itself to the top of the cell.

this is it here.

 

 //print array here, split off chr(29)  
  echo "<table width='952' border='0'>";

  //$mdata holds the tag names with each number corresponding to the text name

  $loop600 = 1;
  while ($loop600 < 900)//dont show local LOC tags 
   {
    if (!empty($taggs[$loop600]))
     {
      $arr = explode(chr(29),$taggs[$loop600]);
      //if ($loop600 == 650) {print_r ($arr);}
       echo " <tr>";
       echo " <td WIDTH='350';vertical-align='top'; align='right'>$mdata[$loop600]</td>"; //the names of the numbered fields
       echo " <td WIDTH='600';vertical-align='top'; align='left'>$arr[2]</td>"; //the first data of the subfield of the tag
       echo " </tr>";
       for ($i = 3; $i < count($arr); $i += 2)
        {
         echo " <tr>";
         echo " <td>"." "."</td>";
         echo " <td>".$arr[($i+1)] ."</td>";
         echo " </tr>";
         }
       $arr = array();
     }
    $loop600 = ($loop600 +1);
  }

Link to comment
https://forums.phpfreaks.com/topic/229763-vertical-aligntop-ignored-in-table/
Share on other sites

fixed with these, either one will work by help from

http://ubuntuforums.org/showthread.php?p=10528481#post10528481

 

  //   echo " <td WIDTH='350' VALIGN='top' align='right'>$mdata[$loop600]</td>"; //the names of the numbered fields
  //   echo " <td WIDTH='600' VALIGN='top' align='left'>$arr[2]</td>"; //the first data of the subfield of the tag  
       echo " <td style='width:350px;vertical-align:top;text-align:right;'>$mdata[$loop600]</td>"; //the names of the numbered fields
       echo " <td style='width:600px;vertical-align:top;text-align:left;'>$arr[2]</td>"; //the first data of the subfield of the tag  

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.