Welcome Guest, Not a member yet? Register   Sign In
HTML Table display horizontally/changing orientation
#3

[eluser]John_Betong[/eluser]
WHOOPS I completely missed the point and was way off on a tangent!

Never mind you now have an alternative to scroll horizontallySmile

Try this instead for a solution to list all your table fields vertically:

Code:
$sql    = 'select * from YOUR_TABLE_NAME_GOES_HERE';
  $query  = $this->db->query($sql);
      
  echo "<div style='position:relative; width:800px;'>";        

    foreach ($query->result() as $row):
      echo "<div style=' float:left; clear:right; width:20%; background:#ffa none'>";
        foreach($row as $line):
          echo '<p>';
            echo substr($line, 0, 142); // change to suit
          echo '</p>';
        endforeach;  
      echo '</div>';  
    endforeach;
          
  echo '</div>';

The idea of the second <div...> was to get the rows to display in a grid. If this is not required then rem out the start and finish of the <div...>.

Cheers,

John_Betong


Messages In This Thread
HTML Table display horizontally/changing orientation - by El Forum - 08-09-2007, 08:32 AM
HTML Table display horizontally/changing orientation - by El Forum - 08-11-2007, 12:14 AM
HTML Table display horizontally/changing orientation - by El Forum - 08-11-2007, 06:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB