code: public String fixTableHeads(String content) {
  
  		Element body = parseContent(content);
  		
  		// select rows with <th> tags within <tbody>
  		List<Element> tableHeadRows = body.select("table > tbody > tr:has(th)");
  		if (tableHeadRows.size() > 0) {
  			for (Element row : tableHeadRows) {
  				
  				// get the row's table
  				Element table = row.parent().parent();
  				
  				// remove row from its original position
  				row.remove();
  				
  				// create table header element with the row
  				Element thead = new Element(Tag.valueOf("thead"), "");
  				thead.appendChild(row);
  				// add at the beginning of the table
  				table.prependChild(thead);
  			}
  			
  			return body.html();
  		} else {
  			// nothing changed
  			return content;
  		}
  	}
docs: Fixes table heads: wraps rows with {@code <th>} (table heading) elements into {@code <thead>}
  element if they are currently in {@code <tbody>}.
  
  @param content
  HTML content to modify
  @return HTML content with all table heads fixed. If all heads were correct, the original
  content is returned.
  @since 1.0