1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HTML: Table Issue

Discussion in 'Web Development & Web Hosting' started by Fergal1982, Oct 30, 2007.

  1. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    I have two tables on one of my pages. In the code they appear underneath each other, and both appear to be properly terminated.

    However, unless I put in a heap of <p>&nbsp;</p> (27 to be precise), the second table appears to the right of the first. Varying the number changes the position of the table on the page, but it takes the full 27 to get the second table far enough down the page that its past the first, and comes over to the left hand side.

    Does anyone have any idea how to resolve this? I've never even seen this before.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  2. dmarsh

    dmarsh Terabyte Poster

    3,782
    302
    184
    HTML is generally based on flow based layout of block level elements.

    I'd insert a line break tag <br/> after the first table, alternatively design your page as a fixed size page and put appropriate sizes on the top level elements and percentage sizes on the lower level elements.
     
    Certifications: CITP, BSc, HND, SCJP, SCJD, SCWCD, SCBCD, SCEA, N+, Sec+, Proj+, Server+, Linux+, MCTS, MCPD, MCSA, MCITP, CCDH
  3. ThomasMc

    ThomasMc Gigabyte Poster

    1,507
    49
    111
    an alternative is to create a DIV with a set size then float the 2 tables with a clear:both in the middle but like dmarsh said a <br /> or <br> should suffice, can you post some of your code
     
    Certifications: MCDST|FtOCC
    WIP: MCSA(70-270|70-290|70-291)
  4. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    Its auto-generated code by a program called CodeCharge. The program itself can do some quite powerful stuff quite easily, and it auto-generates a shedload of code for you, but its a nightmare sometimes.

    I tried using <br />'s instead of the <p>'s before, but they encountered the same issues.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  5. ThomasMc

    ThomasMc Gigabyte Poster

    1,507
    49
    111
    heres an example of the floating i was talking about, not sure how to do it in your program as i only use text editors these days
     

    Attached Files:

    Certifications: MCDST|FtOCC
    WIP: MCSA(70-270|70-290|70-291)
  6. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    WYSIWYGs are notorious for adding krap that you don't want to your html. I agree with ThomasMc's solution in this case.
     
    Certifications: A+ and Network+
  7. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    Fully agree, unfortunately it was coded in this before I started. Cant really start it all again, so have to go with the status quo (for now).

    I'll take a look at Thomas' solution, see how it goes (I can get to the HTML code and edit it, so thats not a problem)
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  8. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    Gods! That actually made it worse!

    Stuck the div's in, and most of the bottom table vanished. Although the bit that did appear appeared where intended.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  9. ThomasMc

    ThomasMc Gigabyte Poster

    1,507
    49
    111
    sound a bit like an unclosed tag
     
    Certifications: MCDST|FtOCC
    WIP: MCSA(70-270|70-290|70-291)
  10. BrotherBill

    BrotherBill Byte Poster

    228
    24
    15
    Hi Fergal,

    Without seeing the code itself, we can only guess. Recheck all of your closing tags. You may have a missing </tr> close tag. If you can get to the html source, try to copy the affected part and post it here. It may help.

    Good Luck,
    Bill
     
  11. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    FFS, you know what it was? There is commented code on the page thats auto-generated by CC marking the beginning and the end of the grid html code. I'd placed them inside these comments. Turns out that CC seems to be doing something with those comments. placing the tags on the other side seems to have resolved the problem.

    Cheers
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  12. dmarsh

    dmarsh Terabyte Poster

    3,782
    302
    184
    Certifications: CITP, BSc, HND, SCJP, SCJD, SCWCD, SCBCD, SCEA, N+, Sec+, Proj+, Server+, Linux+, MCTS, MCPD, MCSA, MCITP, CCDH
  13. dmarsh

    dmarsh Terabyte Poster

    3,782
    302
    184
    Its common for round trip code generation tools to use these practicies, they use comments of various forms to denote parts of the file that can be automatically replaced when the code is regenerated, you have to be careful where and what you edit, otherwise you will simply lose the changes the next time the tool is run.
     
    Certifications: CITP, BSc, HND, SCJP, SCJD, SCWCD, SCBCD, SCEA, N+, Sec+, Proj+, Server+, Linux+, MCTS, MCPD, MCSA, MCITP, CCDH
  14. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    Nice catch Dmarsh.

    I also found This from MS. Looks ok.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  15. dmarsh

    dmarsh Terabyte Poster

    3,782
    302
    184
    Certifications: CITP, BSc, HND, SCJP, SCJD, SCWCD, SCBCD, SCEA, N+, Sec+, Proj+, Server+, Linux+, MCTS, MCPD, MCSA, MCITP, CCDH

Share This Page

Loading...