Here you can find the source of writeToTable(String serialColumnValue, ArrayList
Parameter | Description |
---|---|
serialColumnValue | a parameter |
columnValues | a parameter |
public static String writeToTable(String serialColumnValue, ArrayList<String> columnValues)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { /**/*from w w w. ja v a 2 s .c om*/ * @param serialColumnValue * @param columnValues * @return a HTML String with a row populated. * * Before calling this please verify that your header row and column row has same no of cells. * Otherwise the output will be distracted/unreadable/unreliable * */ public static String writeToTable(String serialColumnValue, ArrayList<String> columnValues) { StringBuffer _temp; int _columnSize; _columnSize = columnValues.size(); _temp = new StringBuffer("<TR><TD>"); _temp.append(serialColumnValue); _temp.append("</TD>"); for (int _index = 0; _index < _columnSize; _index++) { _temp.append("<TD>"); _temp.append(columnValues.get(_index)); _temp.append("</TD>"); } _temp.append("</TR>"); return _temp.toString(); } }