public class Table extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
Table |
addColumns(int qty)
追加列, 每一行追加,追加的列将复制前一列的样式(背景色、字体等)
|
Table |
addRows(int qty) |
Table |
addRows(int index,
int qty) |
Table |
addTr(Tr tr)
添加行
|
String |
build() |
String |
build(boolean box)
创建html
|
String |
getClazz() |
String |
getFooter() |
String |
getHeader() |
int |
getMaxColSize() |
org.dom4j.Element |
getSrc() |
Map<String,String> |
getStyles() |
Td |
getTd(int row,
int col) |
String |
getText(int row,
int col)
单元格文本
|
Tr |
getTr(int index) |
List<Tr> |
getTrs() |
String |
getWidthUnit() |
Table |
insertColumns(int col,
int qty)
插入列
追加的列将复制前一列的样式(背景色、字体等)
如果col=0则将制后一列的样式(背景色、字体等)
|
Table |
insertRows(int index,
int qty)
追加行,追加的行将复制上一行的样式(背景色、字体等)
|
Table |
insertRows(Tr template,
int index,
int qty) |
Table |
offset() |
Td |
removeBackgroundColor(int rows,
int cols)
清除背景色
|
Td |
removeBorder(int rows,
int cols) |
Td |
removeBorder(String side,
int rows,
int cols) |
Td |
removeBottomBorder(int rows,
int cols) |
Td |
removeColor(int rows,
int cols)
清除颜色
|
Td |
removeLeftBorder(int rows,
int cols) |
Td |
removeRightBorder(int rows,
int cols) |
Td |
removeStyle(int rows,
int cols)
清除样式
|
Td |
removeTl2brBorder(int rows,
int cols) |
Td |
removeTopBorder(int rows,
int cols) |
Td |
removeTr2blBorder(int rows,
int cols) |
Td |
setAlign(int rows,
int cols,
String align)
设置文本水平对齐方式
|
Td |
setBackgroundColor(int rows,
int cols,
String color)
背景色
|
Td |
setBold(int rows,
int cols) |
Td |
setBold(int rows,
int cols,
boolean bold)
粗体
|
Td |
setBorder(int rows,
int cols) |
Td |
setBorder(int rows,
int cols,
String side,
double width,
String color,
String style) |
Td |
setBorder(int rows,
int cols,
String side,
int width,
String color,
String style) |
Td |
setBorder(int rows,
int cols,
String weight,
String color,
String style) |
Td |
setBorder(int rows,
int cols,
String side,
String width,
String color,
String style) |
Td |
setBottomBorder(int rows,
int cols) |
Td |
setBottomBorder(int rows,
int cols,
double width,
String color,
String style) |
Td |
setBottomBorder(int rows,
int cols,
int width,
String color,
String style) |
Td |
setBottomBorder(int rows,
int cols,
String width,
String color,
String style) |
Td |
setBottomPadding(int rows,
int cols,
double padding) |
Td |
setBottomPadding(int rows,
int cols,
int padding) |
Td |
setBottomPadding(int rows,
int cols,
String padding) |
void |
setClazz(String clazz) |
Td |
setColor(int rows,
int cols,
String color) |
Td |
setColspan(int rows,
int cols,
int colspan) |
Td |
setDelete(int rows,
int cols) |
Td |
setDelete(int rows,
int cols,
boolean strike) |
Td |
setFont(int rows,
int cols,
String weight,
String eastAsia,
String ascii,
String hint) |
Td |
setFontFamily(int rows,
int cols,
String font) |
Td |
setFontSize(int rows,
int cols,
String weight) |
Td |
setFontWeight(int rows,
int cols,
String weight) |
void |
setFooter(String footer) |
void |
setHeader(String header) |
Td |
setItalic(int rows,
int cols) |
Td |
setItalic(int rows,
int cols,
boolean italic)
斜体
|
Td |
setLeftBorder(int rows,
int cols) |
Td |
setLeftBorder(int rows,
int cols,
double width,
String color,
String style) |
Td |
setLeftBorder(int rows,
int cols,
int width,
String color,
String style) |
Td |
setLeftBorder(int rows,
int cols,
String width,
String color,
String style) |
Td |
setLeftPadding(int rows,
int cols,
double padding) |
Td |
setLeftPadding(int rows,
int cols,
int padding) |
Td |
setLeftPadding(int rows,
int cols,
String padding) |
Td |
setLineHeight(int rows,
int cols,
double height) |
Td |
setLineHeight(int rows,
int cols,
int height) |
Td |
setLineHeight(int rows,
int cols,
String height)
设置行高
|
Table |
setMergeCol(int start,
int qty)
设置需要合并的列(根据内容)
|
Table |
setMergeRow(Integer... cols)
设置需要合并行的列
|
Table |
setMergeRow(String... cols)
设置需要合并行的列下标
|
Td |
setPadding(int rows,
int cols,
double padding) |
Td |
setPadding(int rows,
int cols,
int padding) |
Td |
setPadding(int rows,
int cols,
String padding) |
Td |
setPadding(int rows,
int cols,
String side,
double padding) |
Td |
setPadding(int rows,
int cols,
String side,
int padding) |
Td |
setPadding(int rows,
int cols,
String side,
String padding) |
Td |
setRightBorder(int rows,
int cols) |
Td |
setRightBorder(int rows,
int cols,
double width,
String color,
String style) |
Td |
setRightBorder(int rows,
int cols,
int width,
String color,
String style) |
Td |
setRightBorder(int rows,
int cols,
String width,
String color,
String style) |
Td |
setRightPadding(int rows,
int cols,
double padding) |
Td |
setRightPadding(int rows,
int cols,
int padding) |
Td |
setRightPadding(int rows,
int cols,
String padding) |
Td |
setRowspan(int rows,
int cols,
int rowspan) |
void |
setSrc(org.dom4j.Element src) |
Td |
setStrike(int rows,
int cols) |
Td |
setStrike(int rows,
int cols,
boolean strike)
删除线
|
void |
setStyles(Map<String,String> styles) |
Table |
setTd(int rows,
int cols,
Td td) |
Table |
setText(int row,
int col,
String text) |
Td |
setTl2brBorder(int rows,
int cols) |
Td |
setTl2brBorder(int rows,
int cols,
double width,
String color,
String style) |
Td |
setTl2brBorder(int rows,
int cols,
int width,
String color,
String style) |
Td |
setTl2brBorder(int rows,
int cols,
String top,
String bottom)
设置左上至右下边框
|
Td |
setTl2brBorder(int rows,
int cols,
String width,
String color,
String style) |
Td |
setTopBorder(int rows,
int cols) |
Td |
setTopBorder(int rows,
int cols,
double width,
String color,
String style) |
Td |
setTopBorder(int rows,
int cols,
int width,
String color,
String style) |
Td |
setTopBorder(int rows,
int cols,
String width,
String color,
String style) |
Td |
setTopPadding(int rows,
int cols,
double padding) |
Td |
setTopPadding(int rows,
int cols,
int padding) |
Td |
setTopPadding(int rows,
int cols,
String padding) |
Td |
setTr2blBorder(int rows,
int cols) |
Td |
setTr2blBorder(int rows,
int cols,
double width,
String color,
String style) |
Td |
setTr2blBorder(int rows,
int cols,
int width,
String color,
String style) |
Td |
setTr2blBorder(int rows,
int cols,
String top,
String bottom)
设置左上至右下边框
|
Td |
setTr2blBorder(int rows,
int cols,
String width,
String color,
String style) |
void |
setTrs(List<Tr> trs) |
Td |
setUnderline(int rows,
int cols) |
Td |
setUnderline(int rows,
int cols,
boolean underline)
下划线
|
Td |
setVerticalAlign(int rows,
int cols,
String align)
设置文本垂直对齐方式
|
Table |
setWidth(String width) |
void |
setWidthUnit(String widthUnit) |
public Td getTd(int row, int col)
public Tr getTr(int index)
public String getWidthUnit()
public void setWidthUnit(String widthUnit)
public org.dom4j.Element getSrc()
public void setSrc(org.dom4j.Element src)
public Table addColumns(int qty)
qty - 追加数量public Table insertColumns(int col, int qty)
col - 插入位置 -1:表示追加以最后一行qty - 数量public Table insertRows(int index, int qty)
index - 位置qty - 追加数量public Table addRows(int qty)
public Table addRows(int index, int qty)
public String build(boolean box)
box - 是否需要table标签public String build()
public Table offset()
public int getMaxColSize()
public Table setMergeRow(String... cols)
cols - 依据列1,2,3(1,2) 第1,2,3列值相同时合并行,第3列合并的前提是第1,2列已合并public Table setMergeCol(int start, int qty)
start - 开始qty - 右侧合并范围public String getText(int row, int col)
row - rowcol - colpublic String getClazz()
public void setClazz(String clazz)
public String getHeader()
public void setHeader(String header)
public String getFooter()
public void setFooter(String footer)
public Td removeLeftBorder(int rows, int cols)
public Td removeRightBorder(int rows, int cols)
public Td removeTopBorder(int rows, int cols)
public Td removeBottomBorder(int rows, int cols)
public Td removeTl2brBorder(int rows, int cols)
public Td removeTr2blBorder(int rows, int cols)
public Td removeBorder(int rows, int cols)
public Td setBorder(int rows, int cols)
public Td setLeftBorder(int rows, int cols)
public Td setRightBorder(int rows, int cols)
public Td setTopBorder(int rows, int cols)
public Td setBottomBorder(int rows, int cols)
public Td setTl2brBorder(int rows, int cols)
public Td setTl2brBorder(int rows, int cols, String top, String bottom)
rows - rowscols - colstop - 右上文本bottom - 左下文本public Td setTr2blBorder(int rows, int cols)
public Td setTr2blBorder(int rows, int cols, String top, String bottom)
rows - rowscols - colstop - 左上文本bottom - 右下文本public Td setRightBorder(int rows, int cols, String width, String color, String style)
public Td setRightBorder(int rows, int cols, double width, String color, String style)
public Td setBottomBorder(int rows, int cols, String width, String color, String style)
public Td setBottomBorder(int rows, int cols, int width, String color, String style)
public Td setBottomBorder(int rows, int cols, double width, String color, String style)
public Td setTl2brBorder(int rows, int cols, String width, String color, String style)
public Td setTl2brBorder(int rows, int cols, double width, String color, String style)
public Td setTr2blBorder(int rows, int cols, String width, String color, String style)
public Td setTr2blBorder(int rows, int cols, double width, String color, String style)
public Td setBorder(int rows, int cols, String side, String width, String color, String style)
public Td setBorder(int rows, int cols, String side, int width, String color, String style)
public Td setBorder(int rows, int cols, String side, double width, String color, String style)
public Td setFont(int rows, int cols, String weight, String eastAsia, String ascii, String hint)
public Td setAlign(int rows, int cols, String align)
rows - rowscols - colsalign - left center rightpublic Td setVerticalAlign(int rows, int cols, String align)
rows - rowscols - colsalign - top middle|center bottompublic Td setBackgroundColor(int rows, int cols, String color)
rows - rowscols - colscolor - 颜色public Td removeStyle(int rows, int cols)
rows - rowscols - colspublic Td removeBackgroundColor(int rows, int cols)
rows - rowscols - colspublic Td removeColor(int rows, int cols)
rows - rowscols - colspublic Td setBold(int rows, int cols, boolean bold)
rows - rowscols - colsbold - 是否public Td setBold(int rows, int cols)
public Td setUnderline(int rows, int cols, boolean underline)
rows - rowscols - colsunderline - 是否public Td setUnderline(int rows, int cols)
public Td setStrike(int rows, int cols, boolean strike)
rows - rowscols - colsstrike - 是否public Td setStrike(int rows, int cols)
public Td setDelete(int rows, int cols)
public Td setDelete(int rows, int cols, boolean strike)
public Td setItalic(int rows, int cols, boolean italic)
rows - rowscols - colsitalic - 是否public Td setItalic(int rows, int cols)
public Td setLineHeight(int rows, int cols, String height)
rows - rowscols - colsheight - pt/px/cmpublic Td setLineHeight(int rows, int cols, int height)
public Td setLineHeight(int rows, int cols, double height)
public Td setColspan(int rows, int cols, int colspan)
public Td setRowspan(int rows, int cols, int rowspan)
public Td setPadding(int rows, int cols, int padding)
public Td setPadding(int rows, int cols, double padding)
public Td setBottomPadding(int rows, int cols, int padding)
public Td setBottomPadding(int rows, int cols, double padding)
public Td setTopPadding(int rows, int cols, int padding)
public Td setTopPadding(int rows, int cols, double padding)
public Td setRightPadding(int rows, int cols, int padding)
public Td setRightPadding(int rows, int cols, double padding)
public Td setLeftPadding(int rows, int cols, int padding)
public Td setLeftPadding(int rows, int cols, double padding)
Copyright © 2022. All rights reserved.