if you're bored, you're not paying attention

Tables in Movable Type entries.

Thought I’d post a quick tip on this, since I couldn’t find it published anywhere else: If you’ve got a table you want to put inside an MT entry, you’ve got to put all the HTML table code on a single line. Otherwise, MT will add <br /> tags after every line — and when the page is published, these line breaks will add up to a huge, inexplicable white space just above the table.

3 Comments

  1. Scot Hacker

    I think the cleaner approach is to turn off the “Add line breaks” option in that entry’s formatting. Doing so will require you to add P or BR tags to the rest of the content in that entry manually, but it’s cleaner than funking up the table (I do this for the polls on Birdhouse, so the PHP code they include doesn’t get HTML-ized).

  2. Waveflux

    I’ve been searching all over this morning for a reason for that inexplicable white space – many thanks!

    Scot has a good point about not wanting to mung the table code, but it seems like the lesser of two evils in my situation (creating a weblog/magazine for use by literary folk who are even less web-savvy than I am).

    This should be just a temporary fix; I think my path forward is to eschew tables and try CSS and DIVs, maybe?

  3. Dylan

    Lots of CSS designers try to avoid using tables at all, but I think that’s overkill. Sure, CSS can do layout better than tables can. But when you’ve got tabular data, you should put it in tables!

© 2024 dylan tweney

Theme by Anders NorenUp ↑

Discover more from dylan tweney

Subscribe now to keep reading and get access to the full archive.

Continue reading