messed up tables?

Discussion in 'HTML & Website Design' started by izlik, Jan 14, 2008.

  1. #1
    hello, i have this code bellow where i have 3 tables within another table

    my problem is that the tables for the included files recent_1.php recent_2.php recent_3.php get's totaly messed up when i try to center them, and i wonder if someone can help

    what is get right now is that the line up under eachother

    recent_1.php
    recent_2.php
    recent_3.php

    and i want them centerd like this on the same row,

    recent_1.php recent_2.php recent_3.php

    i hope that someone can help

    <html>
    
    	<body>
    
    <table border="1" cellpadding="0" cellspacing="0" width="952" height="952" bgcolor="#FFFFFF">
    		<tr>
    		<td valign="top" height="146">
    		<!-- MSCellType="ContentHead2" -->
    		<center><b>&nbsp;</center><br><cebter><span style="font-size: 15pt; font-weight: 700; text-decoration: underline"><center>
    		&nbsp;</center></font><br><?
    include 'includes/featuredlist.php'; ?></td>
    	</tr>
    	<tr>
    		<td valign="top" width="283">
    		<!-- MSCellType="ContentBody" -->
    		<table border="1" width="33%" bgcolor="#FFFFFF" align="center">
    
    		<td><?
    include 'includes/recent_1.php'; ?></td>
    	
    		</table>
    		<table border="1" width="33%" bgcolor="#FFFFFF" align="center">
    
    		<td><?
    include 'includes/recent_2.php'; ?></td>
    	
    		</table>
    		<table border="1" width="33%" bgcolor="#FFFFFF" align="center">
    
    		<td><?
    include 'includes/recent_3.php'; ?></td>
    	
    		</table>
    		</td>
    		</table>
    		
    </body>
    
    </html>
    HTML:
     
    izlik, Jan 14, 2008 IP
  2. unitedlocalbands

    unitedlocalbands Well-Known Member

    Messages:
    246
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    #2
    You could first try changing all you table atributes to style tags.

    Like this


    
    <html>    
    <body>
    <table style="width:952; height:952; background-color:#FFFFFF; border:1px;" cellpadding="0" cellspacing="0" >        
    <tr>       
     <td style="vertical-align:top; width:146px;">       
      <!-- MSCellType="ContentHead2" -->        
      <center><b>&nbsp;</b></center><br/>
      <center><span style="font-size:15pt; font-weight:700px; text-decoration:underline;"></span></center>
      <center>&nbsp;</center><br/>
      <?include 'includes/featuredlist.php'; ?>
         </td>   
       </tr>   
        <tr>       
         <td style="vertical-align:top; width:283px;">        
         <!-- MSCellType="ContentBody" -->       
          <table style="border:1px; width:33%; background-color:#FFFFFF; text-align:center;">        
          <tr>
          <td><?include 'includes/recent_1.php'; ?></td> 
          </tr>           
          </table>        
          <table style="border:1px; width:33%; background-color:#FFFFFF; text-align:center;">       
           <tr>
           <td><?include 'includes/recent_2.php'; ?></td> 
           </tr>           
           </table>        
           <table style="border:1px; width:33%; background-color:#FFFFFF; text-align:center;">       
            <tr>
            <td><?include 'includes/recent_3.php'; ?></td>
            </tr>           
             </table>       
              </td> 
              </tr>       
              </table>        
              </body>
              </html>
    
    PHP:
    I also found some missing end tags and some missing <tr> tags which are needed by the table to build a row.

    You should always specify what units you would like when you set a width or height;

    Like 33px; or 33% dont leave it up to the browser to decied because they will all pick something different.

    I hope this help and doesnt make it worst.

    If you want these tables to be next to eachother just get rid of a couple of the table tags like this

    
    <html>    
    <body>
    <table style="width:952; height:952; background-color:#FFFFFF; border:1px;" cellpadding="0" cellspacing="0" >        
       <tr>       
         <td style="vertical-align:top; width:146px;">       
      <!-- MSCellType="ContentHead2" -->        
      <center><b>&nbsp;</b></center><br/>
      <center><span style="font-size:15pt; font-weight:700px; text-decoration:underline;"></span></center>
      <center>&nbsp;</center><br/>
      <?include 'includes/featuredlist.php'; ?>
           </td>   
       </tr>
       
        <tr>       
         <td style="vertical-align:top; width:283px;">        
         <!-- MSCellType="ContentBody" -->       
          <table style="border:1px; width:33%; background-color:#FFFFFF; text-align:center;">        
          <tr>
          <td><?include 'includes/recent_1.php'; ?></td> 
                 
          <td><?include 'includes/recent_2.php'; ?></td> 
           
           <td><?include 'includes/recent_3.php'; ?></td>
            
          </tr>           
        </table>       
                </td> 
              </tr>       
            </table>        
    </body>
    </html>
    
    PHP:
     
    unitedlocalbands, Jan 14, 2008 IP
  3. unitedlocalbands

    unitedlocalbands Well-Known Member

    Messages:
    246
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    #3
    After reviewing my last post I see that I did forget to put px after a width atribute in the first line. Be sure to fix that before you use these tables.
     
    unitedlocalbands, Jan 15, 2008 IP
  4. largn81

    largn81 Peon

    Messages:
    237
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks a lot, ;) :) it is what i was looking for
     
    largn81, Jan 26, 2008 IP