Skip to main content

Tables Are Very Sensitive To Gratuitous Line Breaks

A table is a great way to organise content in your blog. With related data positioned above or next to each other, and still allowed to flow from line to line, as a display coded in HTML is designed to do, you can show the various relationships easier. But use tables carefully - they are syntactically sensitive.

The problem is easy to show, by example.

Here's a very simple table - 1 row, 2 cells.


Make this line
Appear above this line
And make this line
Appear just above this line

<span style="text-align:center;"><table align="center" border=1><tr><td><table align="center" border=1 cellpadding="20"><tr><td>Make this line<br>Appear above this line</td></tr></table></td><tr><td>And make this line<br>Appear just above this line</td></tr></table></td></tr></table></span>


Add gratuitous line breaks, which makes it easier to read the source code, and it becomes a bit untidy.













Make this line


Appear above this line

And make this line
Appear just above this line




<span style="text-align:center;">
<table align="center" border=1>
<tr>
<td>
<table align="center" border=1 cellpadding="20"><tr>
<td>
Make this line
<br>
Appear above this line
</td>
</tr>
</table>
</td>
<tr>
<td>
And make this line
<br>
Appear just above this line
</td>
</tr>
</table>
</td>
</tr>
</table>
</span>


If you have "Convert line breaks?" set to "Yes", as many bloggers typically do, every new line in the middle of the table is rendered at the top or bottom of the table. The more cells, columns, and rows present, the worse the problem gets.

Just remove all gratuitous line breaks, carefully, from the "<table> ... </table>" code.

>> Top

Comments

Jerry's Dallas said…
Thank you. You have helped me more than you will ever know.
Thankyou so much for this post. It has been a god-send. I've had that much trouble with tables in Blogger. And now I know why.

Popular posts from this blog

Adding A Link To Your Blog Post

Occasionally, you see a very odd, cryptic complaint I just added a link in my blog, but the link vanished! No, it wasn't your imagination.

What's The URL Of My Blog?

We see the plea for help, periodically I need the URL of my blog, so I can give it to my friends. Help! Who's buried in Grant's Tomb, after all? No Chuck, be polite. OK, OK. The title of this blog is "The Real Blogger Status", and the title of this post is "What's The URL Of My Blog?".

Add A Custom Redirect, If You Change A Post URL

When you rename a blog, the most that you can do, to keep the old URL useful, is to setup a stub post , with a clickable link to the new URL. Yo! The blog is now at xxxxxxx.blogspot.com!! Blogger forbids gateway blogs, and similar blog to blog redirections . When you rename a post, you can setup a custom redirect - and automatically redirect your readers to the post, under its new URL. You should take advantage of this option, if you change a post URL.