Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 10-24-2007, 12:18 AM Trouble with a table
Experienced Talker

Posts: 39
Trades: 0
Hi all, I'm having a bit of trouble getting a table to display right in Mozilla, though it works in IE. Basically, the first row should contain 2 cols, one that is 75% the width of the table, the other 25%. The next row contains 1 col, and the following 2 rows contain 2 cols, each 50% of the table. My problem is that the first row is not 75/25, closer to 60/40. The last 2 rows are pretty close, but depending on what ends up in them, they shift a few pixels to the left or right. You'll notice that I didn't use % for my widths in the code below, when that didn't work I tried using pixels but that didn't work either. Any help would be appreciated.

Code:
  <table border="1" align="center" cellpadding="4" cellspacing="0" width="660px" cols="4">
    <tr>
      <td align="left" class="paragraphfont" bgcolor="#CCCCCC" colspan="3" width="495"><strong class="style2"><font color="#003366" size="2" face="Arial, Helvetica, sans-serif"><span class="link2">Please enter the 7-digit number</span></font></strong></td>
      <td class="paragraphfont" bgcolor="#CCCCCC"><input name="number" type="text" id="number" size="28" /></td>
    </tr>   
    <tr>
      <td align="center" valign="top" class="style2" bgcolor="#CCCCCC" colspan="4"><input type="submit" name="submit" value="Send" /></td>
    </tr>
    <tr>
      <td colspan="2" align="left" class="paragraphfont" bgcolor="#CCCCCC" width="330">
          <? echo"$msg1";?><br />
      </td>
      <td colspan="2" align="left" class="paragraphfont" bgcolor="#CCCCCC" width="330">
          <? echo"$msg2";?><br />
      </td>					
    </tr>
    <tr>
      <td colspan="2" align="left" class="paragraphfont" bgcolor="#CCCCCC" width="330">
          <? echo"$msg3";?><br />
        </span>
      </td>
      <td colspan="2" align="left" class="paragraphfont" bgcolor="#CCCCCC" width="330">
          <? echo"$msg4";?><br />
      </td>					
    </tr>		
  </table>
Prometheus is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-24-2007, 04:26 AM Re: Trouble with a table
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Actually it's IE bad behaviour in trying to "fix" incorrect or confusing markup that is sending you down the wrong track and making you think it's right.

You should not set a column span AND an explicit width on a cell, the width will be calculated from the table and the column count. So remove the width setting and allow the columns to "float" equally in the table.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-24-2007, 05:02 PM Re: Trouble with a table
rion's Avatar
Experienced Talker

Posts: 31
Name: Rion
Location: Portland, Oregon
Trades: 0
This is what I would do:
HTML Code:
<table border="1" align="center" cellpadding="4" cellspacing="0" width="660px" cols="4">
    <tr>
      <td align="left" class="paragraphfont" bgcolor="#CCCCCC" colspan="3"><strong class="style2"><font color="#003366" size="2" face="Arial, Helvetica, sans-serif"><span class="link2">Please enter the 7-digit number</span></font></strong></td>
      <td class="paragraphfont" bgcolor="#CCCCCC"><input name="number" type="text" id="number" size="28" /></td>
    </tr>   
    <tr>
      <td align="center" valign="top" class="style2" bgcolor="#CCCCCC" colspan="4"><input type="submit" name="submit" value="Send" /></td>
    </tr>
    <tr>
      <td align="left" class="paragraphfont" bgcolor="#CCCCCC" colspan="2">
          <? echo"$msg1";?><br />
      </td>
      <td align="left" class="paragraphfont" bgcolor="#CCCCCC" colspan="2">
          <? echo"$msg2";?><br />
      </td>					
    </tr>
    <tr>
      <td align="left" class="paragraphfont" bgcolor="#CCCCCC" colspan="2">
          <? echo"$msg3";?><br />
        </span>
      </td>
      <td align="left" class="paragraphfont" bgcolor="#CCCCCC" colspan="2">
          <? echo"$msg4";?><br />
      </td>					
    </tr>		
  </table>
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
rion is offline
Reply With Quote
View Public Profile Visit rion's homepage!
 
Old 10-25-2007, 02:04 AM Re: Trouble with a table
Experienced Talker

Posts: 39
Trades: 0
I tried the code above but had the same problem. In the end

HTML Code:
<table border="1" align="center" cellpadding="4" cellspacing="0" width="660px" cols="4" style="table-layout:fixed;">
did it for me.
Prometheus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Trouble with a table
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.86551 seconds with 12 queries