View Single Post
Old Yesterday, 01:57 AM   #7
seanos
Zealot
seanos began at the beginning.
 
seanos's Avatar
 
Posts: 118
Karma: 12
Join Date: Apr 2010
Location: Melbourne, Australia
Device: Kobo Sage, Kobo Aura H2O, LG V20
People have definite idiosyncrasies about this kind of thing, so consensus isn’t likely.

My idiosyncrasy is that I like a two-space tab/indent. Also, if I include <thead> & <tbody> I don’t indent them. I like minimal spacing to reduce scrolling. The ‘coalface’ blocks like <td>, <h1> and <p> I don’t put the tags on separate lines, but for larger structural elements like <div> or <tr> I’ll give opening and closing tags their own line.

I’m not 100% consistent though.

Code:
<table>
<tbody>
  <tr>
    <td></td>
    <td></td>
  </tr>
</tbody>
</table>

<div>
  <h1></h1>
  <p></p>
</div>
seanos is offline   Reply With Quote