Here you can find the source of renderHTMLCell(final StringBuffer buffer, final String contents, final String css, final int align)
Parameter | Description |
---|---|
buffer | a parameter |
contents | a parameter |
css | a parameter |
align | a parameter |
public synchronized static void renderHTMLCell(final StringBuffer buffer, final String contents, final String css, final int align)
//package com.java2s; // it under the terms of the GNU General Public License as published by import javax.swing.*; public class Main { public static final String CR_LF = "\r\n"; private static final String ALIGN_LEFT = "left"; private static final String ALIGN_RIGHT = "right"; private static final String ALIGN_CENTER = "center"; /*********************************************************************************************** * Render a single table cell in HTML with an optional style. */*from w w w . ja va 2s . c om*/ * @param buffer * @param contents * @param css * @param align */ public synchronized static void renderHTMLCell(final StringBuffer buffer, final String contents, final String css, final int align) { String strAlign; strAlign = ALIGN_LEFT; if (align == SwingConstants.LEFT) { strAlign = ALIGN_LEFT; } else if (align == SwingConstants.RIGHT) { strAlign = ALIGN_RIGHT; } else if (align == SwingConstants.CENTER) { strAlign = ALIGN_CENTER; } buffer.append("<td"); buffer.append(css); buffer.append(" align="); buffer.append(strAlign); buffer.append(">"); buffer.append(CR_LF); buffer.append(contents); buffer.append(CR_LF); buffer.append("</td>"); buffer.append(CR_LF); } }