Search code examples
javascripthtmlrubyruby-on-rails-5google-console-developer

unwanted <br> tags appearing on web page that are visible using google chrome inspect, but not visible in the app's code


I'm having an issue where my web page is being effected with multiple br tags. I have checked through all my code but they only appear when I inspect the code via google chrome inspect.

I've tried to delete them using the google console but they keep coming back. Any ideas how to fix this would be greatly appreciated.

invisable
tags are appearing in the console but not in the apps code

google console with
tags


Solution

  • A <br> is not allowed inside of a <tr>. Looks like Chrome tries to make sense out of the <br> in one of your <tr>s.

    Just remove the <br> after

    <td><%= order.record.Label %></td> 
    

    and you should be fine.

    Hint: A <tr> is only allowed to contain one or more <th> or <td> elements.