<table border="1">
<tr>
<td>Heading 1</td><td>Heading 2</td><td>Heading 3</td>
</tr>
<tr>
<td>row 1 col 1</td><td>row 1 col 2</td><td>row 1 col 3</td>
</tr>
<tr>
<td>row 2 col 1</td><td>row 2 col 2</td><td>row 2 col 3</td>
</tr>
</table>
If you do this, you will get large white space above the table because Blogger adds a <br /> tag for each time you press the EMTER key to start a new line, causing a line break to be created.
To avoid this, add this before HTML for your table or tables if you have more than 1:
<style type="text/css">.nobrtable br { display: none }</style>
<div class="nobrtable">
Then type the HTML for the table or tables. At the end of the table or tables, add this:
</div>
I have tested the method and you can see the result here:
Testing another way of avoiding large white spaces above the table in Blogger. To make things clearer, I will put the script to display that test post with a short description, 2 headings and two tables in the scroll box below:
I have previously posted about <a href="http://blogger-tricks.blogspot.com/2006/08/how-to-avoid-large-white-space-above_21.html">How to avoid large white space above tables in Blogger</a>.
Got some information from one of my blog reader about another way to do it, so will test it here to see if it works:
<style type="text/css">.nobrtable br { display: none }</style>
<div class="nobrtable">
<h3>First table</h3>
This is the first table I am using for the test. The "data" in the table are actually hyperlinks.
<table border ="1">
<tr>
<td>My First Blogger blog</td>
<td>My Second Blogger blog</td>
<td>My Third Blogger blog</td>
</tr>
<tr>
<td><a href="http://bloggerfordummies.blogspot.com" target="_blank">Blogger for Dummies</a></td>
<td><a href="http://blogger-tricks.blogspot.com" target="_blank">Blogger Tips and Tricks</a></td>
<td><a href="http://dummies-guide-to-google-blogger.blogspot.com" target="_blank">Dummies Guide to Google Blogger</a></td>
</tr>
</table>
<h3>Second table</h3>
<table border="1">
<tr>
<td>Heading 1</td><td>Heading 2</td><td>Heading 3</td>
</tr>
<tr>
<td>row 1 col 1</td><td>row 1 col 2</td><td>row 1 col 3</td>
</tr>
<tr>
<td>row 2 col 1</td><td>row 2 col 2</td><td>row 2 col 3</td>
</tr>
</table>
</div>
Update: As you can see, there are not large white space above the table.
Got some information from one of my blog reader about another way to do it, so will test it here to see if it works:
<style type="text/css">.nobrtable br { display: none }</style>
<div class="nobrtable">
<h3>First table</h3>
This is the first table I am using for the test. The "data" in the table are actually hyperlinks.
<table border ="1">
<tr>
<td>My First Blogger blog</td>
<td>My Second Blogger blog</td>
<td>My Third Blogger blog</td>
</tr>
<tr>
<td><a href="http://bloggerfordummies.blogspot.com" target="_blank">Blogger for Dummies</a></td>
<td><a href="http://blogger-tricks.blogspot.com" target="_blank">Blogger Tips and Tricks</a></td>
<td><a href="http://dummies-guide-to-google-blogger.blogspot.com" target="_blank">Dummies Guide to Google Blogger</a></td>
</tr>
</table>
<h3>Second table</h3>
<table border="1">
<tr>
<td>Heading 1</td><td>Heading 2</td><td>Heading 3</td>
</tr>
<tr>
<td>row 1 col 1</td><td>row 1 col 2</td><td>row 1 col 3</td>
</tr>
<tr>
<td>row 2 col 1</td><td>row 2 col 2</td><td>row 2 col 3</td>
</tr>
</table>
</div>
Update: As you can see, there are not large white space above the table.
Acknowledgement: This post was prepared thanks to an alert from a blogger Nitin of Problems with table formatting with Blogger or blogspot whose information I used with some modification.
Update 2011: For an even easier method of publishing tables without creating unwanted blank space, see How to easily create tables with Windows Live Writer
Update 2: Nitin said in his blog he got the information from another site. He didn't give the link to the site. I was contacted by another blogger saying he probably got it from his site Table formatting in Blogger. This post was dated Saturday, January 13, 2007 while Nitin's post was dated Wednesday, June 27, 2007.



That is awesome. I've always had to remove all the lines and place the code onto 1 long line to get rid of the spaces. This makes it so much easier to read/update.
ReplyDeleteThanks for sharing.
Hello,
ReplyDeletei'm Sain from malaysia..
i just want to ask about making money with google adsense...
i'm very excited when u said that u always got a cheque monthly from google..
congratulations!!!..
for ur information, i have been doing blog for adsense , and until now i still hard to get income from it..
can u teach me how to get my first google adsense cheque???
Thanx uncle...
Hi hssn,
ReplyDeleteI will probably do a post on that hopefully in the very near future, as soon as I get the higher priority tasks out of the way. Will post a link from here when it is done. I am saving the URL of this post and putting it in my "to do 30" folder.
Peter (Blog*Star 2006 and 2007)
Generating Revenue from your Website
Hi, Peter, your site is just right for me. I was just frustrateing about the big space of table, with try your ways. Please visit us at
ReplyDeletehttp://full-time-mothers.blogspot.com
Thanks
RuoHoo
Thanks for the post, it worked for me as well. It was quite a struggle for 30 minutes without any result. But your remedy worked instantly. Please see the blog about our clipping path services
ReplyDeleteI'm so glad that I came across this post while trying to figure out why my table was appearing half way down the page.
ReplyDeleteI followed the link you provided on Blogger Help Group, & in less than 10 seconds = Problem Solved!
After working on the coding for my table for hours, then encountering the "space" problem, your solution saved my sanity. Thank you!
hi. i donno what im doing wrong, but this trick isnt working for me. im copying the exact code you gave me and doing the exact thing u r asking me to do. its working fine with the example code you gave but it isnt working for mine. are there any exceptions??
ReplyDeleteHi Garam,
ReplyDeleteI can't tell what is the problem, but if I am to be faced with a problem like this and don't know what to do, I will create a test blog with a different template, (for this purpose, I will use a browser like FireFox with tabbed browsing), open a new tab to get to
blogger.com/home
Create the test blog with different template, create a post, go back to the tab where I have the post editor window for the problem post with the table, copy the whole post as it is (I am assuming you have made no error), paste it into the new post in the test blog, publish it and see if there is any difference. If it works with a different template, then it means the problem lies in your template.
Please note I am not saying I know what is causing the problem, but what kind of steps I will take to try to troubleshoot the problem.
Peter Blog*Star
Generating Revenue from your Website
Thanks for posting this tip.
ReplyDeleteThis is definitely a two-edged sword.
I don't want "all those extra" line breaks. But I do want some line breaks within the cells. And now, when I use your trick, blogger is ignoring even my explicit line breaks!
I guess the only alternative is to use paragraphs and fiddle with the interparagraph spacing as well!
yep. That worked. I added .nobrtable p {margin-top: 0px; margin-bottom: 0px} to the style statement, with good results.
I like this trick so much that I modified my template. I wound up putting the CSS way at the bottom of the skin section, because when I tried at the beginning, my paragraph style settings were ignored.
ReplyDeleteHere's what I put in the template:
.nobrtable br { display: none }
.nobrtable p { margin-bottom: 0px; margin-top: 0px;}
And here's how I use it in the blog:
<table class="nobrtable">
<tr>
<td><p>Line 1
<p>Line 2
<p>Line 3
</td>
<td>
<p>Each serving contains
<p>Cals: 302, FatCals: 18, TotFat: 2g
<p>SatFat: 1g, PolyFat: 1g, MonoFat: 2g
</td>
</tr>
</table>
Thanks, I was driving myself nuts. LOL.
ReplyDeleteThanks,
Brian
Hi FamilyNutritionist,
ReplyDeleteThanks for the useful tip which looks like it should work. Hope to get time to test it, and if it is confirmed to work, can I use it for a post and attribute it to you?
Peter Blog*Star
Generating Revenue from your Website
Peter,
ReplyDeletePlease feel free to post about my tip. I posted it here so other people could find and use it. You are the vector for that. Thanks for being an essential blogger help supplement!
That is really great. I've only just started using Blogger and have now put my first table in with the minimum of fuss. It's easy when you know how....!
ReplyDeleteYou can see the awesome results at http://worldofhiglet.blogspot.com/2008/02/news-from-verse.html
Thanks again!
Peter, I also got the info about solving white space above tables from MLA Wire. Guess we're pilfering from the same treasure bags! If you're going to steal, might as well steal good stuff.
ReplyDeleteWorked well for me at pc-bargian-news@blogspot.com, but the rss feed shows this:
ReplyDelete.nobrtable br {display:none;}
at the top of the post.
Any ideas?
Thanks,
BobDad
Peter, you are a legend. For every problem I had with Blogger, I found solution here on your blog. Thank you so much and keep up the good work!
ReplyDeleteHi Worldofhighlet,
ReplyDeleteIt is not a good idea to paste blog URL directly into a comment, especially if the URL is a long one. It gives a lot of problem, and is not active (clickable). You may be interested to read
Make active (clickable) links in posts and comments
Improve link popularity and PageRank by removing "nofollow" attribute for comments
The "nofollow" attribute have been removed for comments for this blog, and it will do you a world of good to make any URL active (clickable), however, don't spam as comments are moderated and spam will not be approved.
Peter Blog*Star
Blogger FAQ (Frequently Asked Questions_
(Blogger FAQ in progress. More will be added as I have the time)
Hi Peter,
ReplyDeleteThanks for your helpful comment regarding URLs and I have now learned from my mistake. Extra credit for taking the time to go to my blog! Thanks again,
Worldofhiglet
Hi BobDad,
ReplyDeleteSorry to respond so late but please refer to Why your comments and emails are not getting prompt responses
Regarding
.nobrtable br {display:none;}
I am no expert, but the HTML tag <br /> is what they call a line break. It cause the text or other stuff following it to be displayed in the next line. That may have something to what you got. It says no br, so perhaps failed to see a <br /> tag where it is expecting to see one. Just guessing.
If I have more info, will comment later.
Peter Blog*Star
Food as medicine
great tip...really helped me get those awful white spaces off my posts...
ReplyDeletecheers mate..
I see the original remedy was posted a year ago, yet Blogger still hasn't come up with a cure on the editor!! I tried your recommended method, but sadly it didn't work for me and unless I missed some vital step, I had to resort to saving the table as text and pasting it in, where of course I lost control over adjusting the columns later.
ReplyDeleteAre there any more solutions that are current? Additionally, when I convert the table to html by saving it as a Firefox html file, and copying and pasting into the Blogger html editor, Blogger comes up with a whole series of objections to tags and meta tags, which all have to be eradicated before it will publish the blog! Is it the same in IE?
Thanks,
Paul
Hi Paola,
ReplyDeleteIf this doesn't work for you why don't you try Simple but tedious method of avoiding blank space above table. But by right this method should work as I have tested it before publishing.
Peter Chen Blog*Star
Dream Driven Life(TM)
Worked perfectly, thank you!
ReplyDeleteGreat fix!
ReplyDeleteTried it on another of my sites and I had to use the tip suggested by FamilyNutritionalist. Another big help in allows us to use the line breaks within our tables. Glad to have found this site.
ReplyDeleteThanks a lot! That code was a big help!
ReplyDeleteThank You!!!
ReplyDeleteIch muss mich auch für deinen Tipp bedanken.
ReplyDeleteThanks for amazing content. I am using the knowledge gained from you for my blog for Free Indian share tips and thus hope to benefit the readers.
ReplyDeleteBrilliant. I've been frustrated by this problem for a long time. You made my day.
ReplyDeletehttp://diecastairplanecollectornews.blogspot.com/
Thanks very much for this.
ReplyDeleteI`ll have to watch your blog from now on...
Thanks for this.
ReplyDeleteI will have to watch your blog from now on for tips...
thanks. that solved my problem.
ReplyDeleteAbe.
Thanks that worked like magic
ReplyDeleteASB
Thank you!
ReplyDeleteHi Peter,
ReplyDeleteI have a problem with table formatting.
With the nobrtable code I solved the white space problem but it give rise to another problem. All the linebreaks within a cell are all gone as well.
I need linebreaks in my cells, is there a way to get that done? Appreciates your help. Thx
I haven't tried it myself but I suspect you can introduce line break within the cells itself where you want a line break.
ReplyDeleteThx so much for the response, Peter. I actually tried the way FamilyNutritionists (so thx Family Nutritionists) suggested and it works, but with additional line space in between, but I can live with that. If you want to know what I mean, visit my site and look at the table at http://daddy-o-ramblings.blogspot.com/2009/01/war-on-dengue-chikungunya.html
ReplyDeleteIf you can help me to get rid of the extra linebreak in between that cell I would be very grateful but only when you're free. Or anyone else who's free for that matter, I would appreciate your help. I'm no expert in html so I'd be happy if you can point me towards the right direction.
Once again. Thx
OMG dude, thank you. I've been battling with this and your solution was easy and it worked perfectly. YOU ROCK IT!
ReplyDeletethank you so much!
ReplyDeleteThank, I wish I found this post sooner:)
ReplyDeleteBlessed be, You sir/mam just relieved my strangled mind. I was baffled why in the world is this thing happening and have been stuck on my post for a few hours now. But, you saved the day.
ReplyDeleteThanks for posting this info and updating your old post, that's where I had to go in the first place!
Peace!
Oh Thank You so much. I was going CRAZY trying to figure this out.
ReplyDeleteOMG!!!! I LOVE YOU!!!!! I have been so frustrated because I couldn't figure out why there was white space. It's fixed because of your coding. You ROCK!
ReplyDeleteThanks Very Informative!
ReplyDeleteDitto what Denise aka wererich said. I thought I was losing it! This worked perfectly.
ReplyDeleteOh thank you so much for this! This was driving me crazy! :-p Yay!
ReplyDeleteThank you thank you thank you - that is so helpful - it was driving me crazy
ReplyDeleteMuchas gracias, thank you.
ReplyDeleteYou cure my headache, now my blog looks fine:
http://psychedelic-geometry.blogspot.com/2009/09/binomial-matrix-i.html
It worked great, thanks alot.
ReplyDeleteThis really helped, thank you so much.:)
ReplyDeleteAfter 3 years of blogging and deleting all the white space on my tables, I have found a solution. My blog is table driven as you can see here.
ReplyDeleteThank you very much for the style and easy way to solve this!
Thank you very much!
ReplyDeleteIt did the trick!
Thanks !
ReplyDeleteUseful and elegant code ...
This worked great for me too. I'm using RapidWeaver. I created a table in Word, populated cells with links from Amazon's affiliate program then copied and pasted the table into Rapidweaver.
ReplyDelete<3 you! This worked! Finally.
ReplyDeleteThanks so much for this post. It worked like a charm. I used it successfully here:
ReplyDeletehttp://billandria.blogspot.com/2010/03/vocabulary-list-and-speech.html
works great, thanks
ReplyDeleteWorked like a charm, thanks!
ReplyDeleteThank you SO much. This was driving me crazy. I couldn't figure out why there was all this white space.
ReplyDeleteThanks for the tip!
ReplyDeletetripmgmt.blogspot.com
It really works! Thanks for saving me a lot of time.
ReplyDeleteYou have made me so happy with this post! Thanks so much! I had been stressing about the extra white space and now it is all fixed. You are amazing!
ReplyDeleteThank so much for your trick...It works for my case...
ReplyDeleteBest regards,
foxman
Hiya Peter!
ReplyDeleteThanks for this awesome tip, I was seriously giving myself high blood pressure trying to resolve all the white spaces in my posts :( (I'm very tech unsavvy and know zip abt html! :( )
However, like the Family Nutritionist, whilst I don't want extra white space I do want some line breaks for easy reading- would u be able to advise on how to do tt? I tried FM's tip but I guess I don't know enough abt HTML as it didn't work for me :(
Thanks! :)
Cheers
Z
Thanks so much for the tip! I copied and pasted and Voila! Thank you! :)
ReplyDeleteThank you! This was a very helpful tip!
ReplyDeleteThank
ReplyDeleteI adore your website - nice job!
big white
Thank you, thank you, thank you. This has bothered me since I started blogging.
ReplyDeleteDenise I would also like to draw your attention to my latest post How to easily create tables with Windows Live Writer with which you would not even have to go through the steps described in this post.
ReplyDeleteawesome, thanks alot!!
ReplyDeleteHello Peter,
ReplyDeleteFirst let you say thanks for publishing this beautiful post. But I've found a easy way to insert the tables in web pages by google doc's as I'm also a programmer. As this section can easily done by novice programmer. I hope u like it
1. login to gmail a/c
2. select document which will be top left side of the navigiate bar or login to docs.google.com
3. You will notice at left side of the bar u have "Create New" option, select new SpreadSheet
4. Add all your data which will be in excel format.
5. Remove extra Columns & rows from google SpreadSheet.
6. Save the file with your relevant name.
7. Now go to Share option which will be at the right side, top near to navigiate bar.
8. Now in Share option select Sheets to publish. Publish your file.
9. Next to the below you find "Get a link to the published data". Below this section you find dropdown menu -> Select HTML section
10. You get the embedded HTML code. Copy this section & paste it in your web page.
My blog - http://www.buildtraffic4site.blogspot.com
Excellent. Thank you so very much.
ReplyDeleteSewCalGal
www.sewcalgal.blogspot.com
Great, Thanks a ton! I was wondering what to do about it and nothing seemed to be working. Blogger is weird!
ReplyDeleteSid Kal, you may be interested in an even easier way to publish tables. See easily create tables with Windows Live Writer.
ReplyDeleteAh, you made my day! In retrospect I can't see why I didn't google the solution to this annoying Blogger bug before :o/ Thanks ever so much for this elegant way of bypassing it!
ReplyDeleteThank you Master... This Info Cleared my Headache/
ReplyDelete