Update 05-directive.js

Only look for 'thead' elements at the current level. This allows embedding a child table with a header within a row. Otherwise the header for the child table will render directly below the parent header.