Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Using HTML Tables with SirNot's Html Formatter 1.5

I was wondering if anyone had an idea why I can't seem to post properly formatted html tables within Vanilla.

I'm using SirNot's HTML formatter and I've gone through the code but I can't seem to find any cause.

I've gone in to the CSS and edited the "CommentBody" div so that the text within a table won't be blue, but it seems as though there is some kind of positioning problem. The example below results in a different output, but there is still a problem.

(EDIT: In the post preview, it showed the table as though it had large padding values. What you see below is what I see.)

On my site, it moves the table down approximately the same distance as the height of the table, leaving a large gap between it and the last line of text. Does this have to do with the use of the line-height property used in the Vanilla default CSS?

(EDIT2: I hadn't noticed this before but it seems as though it's adding a lot of br tags in the table.)

Example:
100 200 300
400 500 600
400 500 600
400 500 600
400 500 600
400 500 600
400 500 600
400 500 600
400 500 600

Comments

  • MarkMark Vanilla Staff
    The HtmlFormatter replaces hard-returns with <br /> tags. So, you're actually getting <table><br /><tr><br /><td>my content</td><br /><tr><br /></table> Which causes all of that white space. If you just write your table with no hard return between tags, it will format properly without any extra white space. I imagine he did it this way because NOT putting the br's in there when writing a table would be kind of processor intensive, and also it's a pain in the butt to code that.
  • edited July 2006
    Thank you very much.

    So it should be like this:
    100200300
    100200300
    100200300
    100200300
    400500600
    400500600
    400500600
    400500600
  • NickENickE New
    edited July 2006
    That's actually an easily editable option within the file itself, though, so if you'd rather it not change newlines to line-breaks all you have to do is change the 1 in define('HTML_CONVERT_NEWLINES', 1);to 0.

    And by the way mark, I've made some updates to that (including a system which cleans up markup), if you want to try it out/update it.
This discussion has been closed.