Java ArrayList Print writeToTable(String serialColumnValue, ArrayList columnValues)

Here you can find the source of writeToTable(String serialColumnValue, ArrayList columnValues)

Description

write To Table

License

Open Source License

Parameter

Parameter Description
serialColumnValue a parameter
columnValues a parameter

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

Declaration

public static String writeToTable(String serialColumnValue, ArrayList<String> columnValues) 

Method Source Code


//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();
    }
}

Related

  1. printReport(ArrayList words, ArrayList searched)
  2. printStringArrayList(ArrayList list)
  3. writeArrayList(ArrayList objects, String separator, String final_conjunction, String prefix, String suffix)
  4. writeArrayListToScreen(ArrayList readArrrayList)
  5. writeArrayListToScreen(ArrayList readArrrayList)