Fix for line breaks in blogger while using tables

Line breaks in blogger while using tables in blog posts and stand alone pages  has been a problem blogger has been having for long. Unfortunate till now, any code written in HTML when previewed or viewed in compose mode gets new line breaks, which is totally annoying. It creates unneccessary spaces in posts when publshed.

This is how you fix it.
  • Add the following piece of code before the post or stand alone page in Edit HTML mode while posting. i.e add this css before the post where you dont want line breaks. Most commonly, when you are using a table in the post / page
  • The code is given below
  • <style type="text/css">
    .nobr br { display: none }
  • Then place your table within that class: <div class="nobr"> <div>
Example :

The table for code
 <div class="nobr"><table border="1">  <tr>    <td>GOOG</td>    <td>505.00</td>    <td>2006-01-12</td>  </tr>  <tr>    <td>BRK-A</td>    <td>110,000.00</td>    <td>2006-01-12</td>  </tr></table></div>

 will look like this in post/page

GOOG 505.00 2006-01-12
BRK-A 110,000.00 2006-01-12

Spread The Love, Share Our Article

Related Posts

2 Response to Fix for line breaks in blogger while using tables

September 27, 2013

A billion times of thanks. That was my big headache with html editor. I am using html editor while posting. When I am entering to post for editing in html editor, blogger produce extra hidden line breaks. While updating it saves the post with extra line breaks in tables and ul and li tag also. Thanks for the fix.

December 03, 2013

Nice Tutorial and thanks for it.
after changing template, i have found that all lines in tables hidden
could you help with it please ?

Post a Comment