• newitus

    (@newitus)


    Hi,

    There is a big gap between my first word and the table below on a Page. But I don’t have any extra html code between there. (even I took out the first line of words, my table still being push down so far with the big gap above) How would that be? Any solution would be greatly appreciated.

    I tried with different templates, but it returned the same. I asked my hosting (dreamhost). They don’t think it’s the problem from the latest php version 5.2.1 and should be related to WP latest 2.1.2 then.

    Please see at

    Thank you.

Viewing 15 replies - 1 through 15 (of 26 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    At the end of every row of your table, there’s a outside the actual table contents. These are getting shoved up above the table because they’re not part of the table itself, though they are enclosed by it.

    WordPress is likely adding these because of the newlines in your table’s html. Remove those newlines and the BR’s should go away, along with the extra space.

    Thread Starter newitus

    (@newitus)

    Hi Otto42,

    Thanks for helping out. I don’t get what you were talking about. Here is the code

    <p>(Moving Blankets)</p>
    <TABLE BORDER>
    <TR><TD ALIGN=CENTER>SIZE</TD><TD ALIGN=CENTER>LBS/DOZEN</TD><TD ALIGN=CENTER>COLOR</TD></TR>
    <TR><TD ALIGN=LEFT>70" x 80"</TD><TD ALIGN=CENTER>80 - 84</TD><TD ALIGN=LEFT>Green/Gray</TD></TR>
    <TR><TD ALIGN=LEFT>70" x 80"</TD><TD ALIGN=CENTER>80 - 84</TD><TD ALIGN=LEFT>Dark Blue/Light Blue</TD></TR>
    <TR><TD ALIGN=LEFT>70" x 80"</TD><TD ALIGN=CENTER>72 - 75</TD><TD ALIGN=LEFT>Green/Gray</TD></TR>
    <TR><TD ALIGN=LEFT>70" x 80"</TD><TD ALIGN=CENTER>72 - 75</TD><TD ALIGN=LEFT>Dark Blue/Light Blue</TD></TR>
    <TR><TD ALIGN=LEFT>70" x 80"</TD><TD ALIGN=CENTER>65 - 70</TD><TD ALIGN=LEFT>Light Blue/Black</TD></TR>
    <TR><TD ALIGN=LEFT>70" x 54"</TD><TD ALIGN=CENTER>35 - 40</TD><TD ALIGN=LEFT>Light Blue/Black</TD></TR>
    </TABLE>

    Can you point out specifically on the code?

    Thank you.

    Thread Starter newitus

    (@newitus)

    Hi,

    After I updated the “Parent Pages” plugin option (include current page), the gap seems getting smaller. But even I deactivated it, the gap still exists.

    Any help?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    The fact that you have that table on multiple lines is the problem. Take this for example:

    <TABLE BORDER>
    <TR>...

    WordPress sees the end of line after <TABLE BORDER> and adds a <BR /> there.

    So, remove the end of line. Make all of that table into one big run on line, without carriage returns.

    macwise

    (@macwise)

    newitus,

    change this:
    <p>(Moving Blankets)</p>

    to this:
    <p style=”margin-bottom: 0px;”>(Moving Blankets)</p>

    That can be modified, btw, to be any value you like. If you’d like a 5px margin on the bottom, then you can change 0px to 5px.

    macwise

    (@macwise)

    by the way, the margin at the bottom of your p tags is specified in your css file. You can override this margin globally for your p tags if you like by changing the class in that file.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    macwise: That won’t solve his problem. Look at the page in Firefox’s DOM Inspector. Notice all the BR’s?

    Thread Starter newitus

    (@newitus)

    Hi Otto42,

    I use the same template/plugin/code at chupkg.com/product
    and no big gap come out. (2.0.2)

    So it’s the version 2.1.12 change causing the problem?

    Thank you.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    It’s most likely one of the changes that was made to the wpautop function, yes.

    Thread Starter newitus

    (@newitus)

    Otto42,

    BTW, how did you view the BRs in Firefox DOM inspector? I’m using Firefox 2.0 and went there but found no BRs.

    I will try to modify the table as you said.

    Thanks again.

    macwise

    (@macwise)

    you’re right, Otto42. I was referring to his code he pasted here, not specifically to that section in his output source. If those BR’s aren’t there in his original source, then this is a WP bug, isn’t it?

    Also, part of his problem appears to be a case of a collapsing p element which should be surrounding the table. Is this what I’m seeing there? (only saw it when I went to the dom inspector). This would also seem the case since in the dom inspector, there are two BR’s before the table, where in his output source there is only one before the table, and one after it. I’m guessing this is much of the issue.

    Newitus, try putting this at the end of your table, before the closing P tag:

    <p class="clearing"></p>

    Then, in your stylesheet, put this:

    .clearing {
    	clear: both;
    	display: block;
    	border: 0;
    	padding: 0;
    	margin: 0;
    }

    If this isn’t a collapsing P element, then forget I even spoke.

    macwise

    (@macwise)

    p.s. this still won’t fix the BR’s appearing from apparently nowhere, but it might put the one at the bottom of the table back where it belongs. It will also get rid of the gap from the bottom margin of the collapsing p element.

    Thread Starter newitus

    (@newitus)

    Hi Otto42,

    I’m getting closer after I put the whole html table code into one line.

    OK, I will try macwise’s suggestion too to see if it close totally.

    Thanks to all.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    If those BR’s aren’t there in his original source, then this is a WP bug, isn’t it?

    wpautop has no shortage of html code that it does not work properly on.

    Thread Starter newitus

    (@newitus)

    Hi,

    I also tried macwise’s solution but still not close totally.

    wpautop has no shortage of html code that it does not work properly on.

    Confusing, is it a bug, right? User has to putting the whole table code into one line to avoid the spaces came from nowhere.

    Plus, I believe that “Parent Pages” plugin
    isn’t working because the 2.1.12 upgrade too.

    Can you two professionals take a look as well?

    Thanks a lot!

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Big gap from nowhere’ is closed to new replies.