border attribute and border style element being stripped from table and th tags

  • Unknown's avatar

    table, tbody and th don’t respect the border attribute or style element. The td tag does, and keep my style attribute with the border element defined. But whenever I attempt to put a border on my table, tbody or th tags, they get stripped or not applied to sub-elements (rows and cells) properly.

    Surely the border attribute is not a security threat to WordPress. Why is it being stripped?

    See the table where I’m attempting to wrap cells in borders at http://mountaincrest1987.wordpress.com/read-bios/
    Blog url: http://mountaincrest1987.wordpress.com/

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Ping! No ideas anyone? It shouldn’t be this hard to do an html table with standard attributes.

  • Unknown's avatar

    A lot of table tags and attributes are now obsolete with HTML5 and cannot be used anymore. In addition, there are a number of attributes that were in use that were NEVER part of any HTML specification and browser support for those is spotty at best. At some point, all the styling for tables will have to be done with inline CSS style declarations and all the table HTML attributes will disappear. See the following page for more information on that.

    http://webdesign.about.com/od/tables/a/aa121597.htm

  • Unknown's avatar

    You might be better served by using one of the online HTML5 table code generators to get you close and then tweak things after inserting the code.

    http://www.quackit.com/html/html_table_generator.cfm

  • Unknown's avatar

    @Rich: But if you check the sourcecode of the post the OP linked to, you’ll see that they are using the style attribute. The actual (and reasonable) complaint is that the style attribute itself gets stripped out if you add it to a th tag.

  • Unknown's avatar

    @Panos, thanks for chiming in on that, and I should have looked closer.

    Another editor bug it would seem.

  • Unknown's avatar

    Thank you both.

    @Rich, I considered HTML5 for about 3 seconds, then realized many folks in my graduating class that would be using this blog, probably wouldn’t come to it with a browser that supports HTML5. If I’ve misunderstood how WP.com works, if it’s the WP.com engine that needs to understand HTML5 and not my blog users’ browser client, then I’m game for HTML5.

    I’m probably going to go with a Google spreadsheet and embed it, to get the look, borders and links within cells that I’m looking for.

  • Unknown's avatar

    Most browsers support more and more of HTML5 with each release, and with Firefox and Chrome, that is every 6 weeks. Safari is also supporting more and more HTML5 with every release.

    It is the BROWSER that has to render the pages, and so the browsers have to know what to do with HTML5. They also look at the DOCTYPE in the HTML source code for a page and decide what version of HTML is being used and then render accordingly. If it sees HTML5, then the browser is very unlikely to accept or render any tags or attributes that are obsolete. They will go by the DOCTYPE.

    WordPress will look for things in code that are obsolete and will strip those out so that there won’t be any XHTML errors or browser rendering problems. This however, the style declaration being stripped out of the “th” tags seems a bug to me that staff need to address.

  • The topic ‘border attribute and border style element being stripped from table and th tags’ is closed to new replies.