Source code: com/lutris/html/HtmlTableDataCell.java
1 /*
2 * Enhydra Java Application Server Project
3 *
4 * The contents of this file are subject to the Enhydra Public License
5 * Version 1.1 (the "License"); you may not use this file except in
6 * compliance with the License. You may obtain a copy of the License on
7 * the Enhydra web site ( http://www.enhydra.org/ ).
8 *
9 * Software distributed under the License is distributed on an "AS IS"
10 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11 * the License for the specific terms governing rights and limitations
12 * under the License.
13 *
14 * The Initial Developer of the Enhydra Application Server is Lutris
15 * Technologies, Inc. The Enhydra Application Server and portions created
16 * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17 * All Rights Reserved.
18 *
19 * Contributor(s):
20 *
21 * $Id: HtmlTableDataCell.java,v 1.8.12.1 2000/10/19 17:58:53 jasona Exp $
22 */
23
24
25
26
27
28 package com.lutris.html;
29
30 import java.util.Vector;
31 import java.util.Enumeration;
32
33 /**
34 * This utility class is used to compose an data cell within a
35 * row within a HTML table. Normally the entire row will be
36 * composed of either data or header cells.
37 *
38 * @see HtmlTable
39 * @see HtmlTableRow
40 * @see HtmlTableHeaderCell
41 * @author Kyle Clark
42 * @author Paul Morgan
43 * @version 1.0 (File $Revision: 1.8.12.1 $)
44 */
45 public class HtmlTableDataCell extends HtmlTableCell {
46
47 public HtmlTableDataCell(String tdValue)
48 {
49 super(tdValue);
50 }
51
52 public HtmlTableDataCell(String tdValue, String defaultValue)
53 {
54 super(tdValue, defaultValue);
55 }
56
57 public String toString()
58 {
59 String html = "<TD";
60 if (align != null)
61 html += " ALIGN=" + align;
62 if (valign != null)
63 html += " VALIGN=" + valign;
64 if (rowSpan > 0)
65 html += " ROWSPAN=" + rowSpan;
66 if (colSpan > 0)
67 html += " COLSPAN=" + colSpan;
68 if (bgColor != null)
69 html += " BGCOLOR=" + bgColor;
70 if (percentWidth > 0)
71 html += " WIDTH=" + percentWidth + "%";
72 html += ">";
73 html += tdValue;
74 html += "</TD>\n";
75 return html;
76 }
77 }