1 29 30 package com.caucho.xtpdoc; 31 32 import javax.xml.stream.XMLStreamException; 33 import javax.xml.stream.XMLStreamWriter; 34 import java.io.IOException ; 35 import java.io.PrintWriter ; 36 37 public class TableHeader extends FormattedTextWithAnchors implements TableCell { 38 private String _width; 39 40 public TableHeader(Document document) 41 { 42 super(document); 43 } 44 45 public void setWidth(String width) 46 { 47 _width = width; 48 } 49 50 public void writeHtml(XMLStreamWriter out) 51 throws XMLStreamException 52 { 53 out.writeStartElement("th"); 54 55 if (_width == null) 56 out.writeAttribute("width", _width); 57 58 super.writeHtml(out); 59 60 out.writeEndElement(); } 62 63 public void writeLaTeX(PrintWriter out) 64 throws IOException  65 { 66 out.print("\\textbf{"); 67 68 super.writeLaTeX(out); 69 70 out.print("}"); 71 } 72 } 73 | Popular Tags |