Line break in html/css code

Line break in html/css code

When I want to handle html/css code in js/jquery it seems that line breaks aren't allowed. This of course makes the code less readable. Is there a workaround to this or is it simply to accept?

This doesn't work:

  1. $("head").append("<style type='text/css'>
  2. #table {table-layout: fixed;width:650px;text-align: left;border-collapse: collapse;}
  3. </style>");

This works:

  1. $("head").append("<style type='text/css'>#table {table-layout: fixed;width:650px;text-align: left;border-collapse: collapse;}</style>");