class TableData {

    public String toHtml()
    {
        String element = "td";
        String spanTxt = "";

        if(header)
        {
            element = "th";
        }

        if(colspan > 1)
        {
            spanTxt = " colspan=\"" + colspan + "\"";
        }

        StringBuffer sb = new StringBuffer(text != null ? text : "");

        if(footnote != null)
        {
            sb.insert(footnote.getPosition(), footnote.toHtml());
        }

        return String.format("<%s%s>%s</%s>", element, spanTxt, sb.toString(), element);
    }

    public  TableData();
    public  TableData(String text);
    public  TableData(String text, int colspan);
    public  TableData(String text, int colspan, boolean header, Footnote footnote);

}