Java HTML Jsoup Element convertTablesToDivs(Element body)

Here you can find the source of convertTablesToDivs(Element body)

Description

convert Tables To Divs

License

Open Source License

Declaration

private static void convertTablesToDivs(Element body) 

Method Source Code

//package com.java2s;

import org.jsoup.nodes.Element;

import org.jsoup.select.Elements;

public class Main {
    private static void convertTablesToDivs(Element body) {
        Elements elements = body.select("table");
        for (Element element : elements) {
            element.tagName("div");
        }//ww  w  .  j  a v a  2  s  .c om

        elements = body.select("tbody");
        for (Element element : elements) {
            element.tagName("div");
        }

        elements = body.select("tr");
        for (Element element : elements) {
            element.tagName("div");
        }

        elements = body.select("th");
        for (Element element : elements) {
            element.tagName("p");
        }

        elements = body.select("td");
        for (Element element : elements) {
            element.tagName("p");
        }
    }
}

Related

  1. collectItemRewards(final Element icontab, final BiConsumer collector)
  2. collectTextUntilNextTag(final Element header, final String nextTagName)
  3. containsLink(Element element, String link)
  4. convertLinksToStrings(Elements links)
  5. convertNodeToText(Element element)
  6. copy(Element e)
  7. countElements(Node parent)
  8. createSafeElement(Element sourceEl)
  9. elementsToList(Elements elements)