Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Borders don't paint right, esp. Firefox 1

Status
Not open for further replies.

OsakaWebbie

Programmer
Feb 11, 2003
628
0
0
JP
Take a look at (an HTML dump from a dynamic site). I can't figure out what I'm doing wrong that Firefox won't render the borders on the tables. After the page loads, if I scroll real slowly I can get almost the whole border to appear (still missing little pieces at the bottom of the thead), but when it first loads, or if I scroll quickly, very little of of the border is visible. In Opera it's the opposite - it looks fine at first, but if I scroll slowly, the vertical border to the right of the "Stock" header gets choppy. I don't really care about that, but it's an indication that there might be more going on than an obscure Firefox bug. (Safari and IE look fine; I haven't tested Chrome.)

Do I have bad CSS or something? The W3C validator does have complaints about my markup (it says I have <thead>, <tbody>, and <tfoot> in invalid places, but I have no idea where else they should be) - I doubt that is related to the border problem, but who knows...

If I disable "border-collapse:collapse" in Firebug, it renders correctly, but I don't see why I shouldn't be able to collapse my borders - I've never had trouble with that before.
 
I see a couple of issues, your theads are never closed. You ahve a <thead> tag openng but then your "closing" <thead> tag is another opeing tag. Its Missing the / to make it a closing. This happens on each and every one of your tables.

The tfoot error stems from the fact that <tfoot> tags must be placed before <tbody> tags.

Code:
<table border="1">
  <thead>
    <tr>
      <th>Month</th>
      <th>Savings</th>
    </tr>
  </thead>
 [b] <tfoot>
    <tr>
      <td>Sum</td>
      <td>$180</td>
    </tr>
  </tfoot>[/b]
  <tbody>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$80</td>
    </tr>
  </tbody>
</table>


Fixing those 2 things should take care of the 49 validations errors. See if it works correctly after that.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Oop! That </thead> without the / was a silly typo that I never saw, and was the cause of the rendering problem. Sometimes another set of eyeballs is needed. Thanks!

As for <tfoot> at the bottom, I know I should have it after <thead>, but I'm building my <tbody> from database rows and totalling them as I go, and although it doesn't validate, browsers don't seem to mind the <tfoot> last - I have previously done that in other pages (I'm not worried about perfect validation as long as it works). But I just now played around with it and discovered that it seems to be permitted to put <th> cells in the <tbody> - it had never occurred to me to try that before. Are there pitfalls with that technique that I should watch out for?

P.S. By the way, I've always liked your signature, the part about the unknown error. I sometimes get an alert box from Windows that has no text at all - just some white space and an OK button. I want to scream at my computer, "No, it's not OK if I don't know what you're telling me!
 
I just found this little tidbit (sorry that I'm quoting it without the context, but you get the idea - Gareth talked about rendering the footer before a long table is finished loading, multiple page printing, etc.):
Note that it's valid to put the tfoot either before or after the tbody s in (X)HTML5. Gareth's reasoning is sound, but like David, most people found the HTML4 way of doing it counter-intuitive, so the rules were relaxed. It makes no difference to the way browsers work, it's just a validity change.
Good news for the future.
 
Glad it worked out.

Yeah there's no major issue in having the tfoot at the bottom of the table unless you are after validity.

As for my sig, its an error I once encountered back in the Windows 98 days, its really an actual error message. It was just so ridiculous that I just had to use it as my quote.

I haven't encountered any other error that's as funny as that one to replace it.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Your error is still the winner, but one I got that made me chuckle was:
The mail server responded: Bad host, no cookie
I imagined a non-techy homemaker saying, "Ah, a message on my computer that I finally understand! I'll have to put out some sweets for the mailman tomorrow.
 
Stupid Error Msg's

To my mind the bets is was from the BIOS during POST

Keyboard Error press F1 to continue.



Mundus vult decipi decipiatur ergo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top