类 Table

java.lang.Object
org.anyline.entity.html.Table

public class Table extends Object
  • 构造器详细资料

    • Table

      public Table()
    • Table

      public Table(int rows, int cols)
      构造表格
      参数:
      rows - 行数量
      cols - 列数量
  • 方法详细资料

    • getTd

      public Td getTd(int row, int col)
    • getTrs

      public List<Tr> getTrs()
    • setTrs

      public void setTrs(List<Tr> trs)
    • getStyles

      public Map<String,String> getStyles()
    • setStyles

      public void setStyles(Map<String,String> styles)
    • getTr

      public Tr getTr(int index)
    • setTd

      public Table setTd(int rows, int cols, Td td)
    • setWidth

      public Table setWidth(String width)
    • getWidthUnit

      public String getWidthUnit()
    • setWidthUnit

      public void setWidthUnit(String widthUnit)
    • getSrc

      public org.dom4j.Element getSrc()
    • setSrc

      public void setSrc(org.dom4j.Element src)
    • addTr

      public Table addTr(Tr tr)
      添加行
      参数:
      tr - tr
      返回:
      table table
    • addColumns

      public Table addColumns(int qty)
      追加列, 每一行追加, 追加的列将复制前一列的样式(背景色、字体等)
      参数:
      qty - 追加数量
      返回:
      table table
    • insertColumns

      public Table insertColumns(int col, int qty)
      插入列 追加的列将复制前一列的样式(背景色、字体等) 如果col=0则将制后一列的样式(背景色、字体等)
      参数:
      col - 插入位置 -1:表示追加以最后一行
      qty - 数量
      返回:
      table table
    • insertRows

      public Table insertRows(int index, int qty)
      追加行, 追加的行将复制上一行的样式(背景色、字体等)
      参数:
      index - 位置
      qty - 追加数量
      返回:
      table table
    • insertRows

      public Table insertRows(Tr template, int index, int qty)
    • addRows

      public Table addRows(int qty)
    • addRows

      public Table addRows(int index, int qty)
    • build

      public String build(boolean box)
      创建html
      参数:
      box - 是否需要table标签
      返回:
      html
    • build

      public String build()
    • offset

      public Table offset()
    • getMaxColSize

      public int getMaxColSize()
    • setMergeRow

      public Table setMergeRow(String... cols)
      设置需要合并行的列下标
      参数:
      cols - 依据列1, 2, 3(1, 2) 第1, 2, 3列值相同时合并行, 第3列合并的前提是第1, 2列已合并
      返回:
      table table
    • setMergeRow

      public Table setMergeRow(Integer... cols)
      设置需要合并行的列
      参数:
      cols - cols
      返回:
      table table
    • setMergeCol

      public Table setMergeCol(int start, int qty)
      设置需要合并的列(根据内容)
      参数:
      start - 开始
      qty - 右侧合并范围
      返回:
      table table
    • getText

      public String getText(int row, int col)
      单元格文本
      参数:
      row - row
      col - col
      返回:
      String
    • setText

      public Table setText(int row, int col, String text)
    • getClazz

      public String getClazz()
    • setClazz

      public void setClazz(String clazz)
    • getHeader

      public String getHeader()
    • setHeader

      public void setHeader(String header)
    • getFooter

      public String getFooter()
    • setFooter

      public void setFooter(String footer)
    • removeLeftBorder

      public Td removeLeftBorder(int rows, int cols)
    • removeRightBorder

      public Td removeRightBorder(int rows, int cols)
    • removeTopBorder

      public Td removeTopBorder(int rows, int cols)
    • removeBottomBorder

      public Td removeBottomBorder(int rows, int cols)
    • removeTl2brBorder

      public Td removeTl2brBorder(int rows, int cols)
    • removeTr2blBorder

      public Td removeTr2blBorder(int rows, int cols)
    • removeBorder

      public Td removeBorder(String side, int rows, int cols)
    • removeBorder

      public Td removeBorder(int rows, int cols)
    • setBorder

      public Td setBorder(int rows, int cols)
    • setBorder

      public Td setBorder(int rows, int cols, String weight, String color, String style)
    • setLeftBorder

      public Td setLeftBorder(int rows, int cols)
    • setRightBorder

      public Td setRightBorder(int rows, int cols)
    • setTopBorder

      public Td setTopBorder(int rows, int cols)
    • setBottomBorder

      public Td setBottomBorder(int rows, int cols)
    • setTl2brBorder

      public Td setTl2brBorder(int rows, int cols)
    • setTl2brBorder

      public Td setTl2brBorder(int rows, int cols, String top, String bottom)
      设置左上至右下边框
      参数:
      rows - rows
      cols - cols
      top - 右上文本
      bottom - 左下文本
      返回:
      td
    • setTr2blBorder

      public Td setTr2blBorder(int rows, int cols)
    • setTr2blBorder

      public Td setTr2blBorder(int rows, int cols, String top, String bottom)
      设置左上至右下边框
      参数:
      rows - rows
      cols - cols
      top - 左上文本
      bottom - 右下文本
      返回:
      td
    • setLeftBorder

      public Td setLeftBorder(int rows, int cols, String width, String color, String style)
    • setLeftBorder

      public Td setLeftBorder(int rows, int cols, int width, String color, String style)
    • setLeftBorder

      public Td setLeftBorder(int rows, int cols, double width, String color, String style)
    • setRightBorder

      public Td setRightBorder(int rows, int cols, String width, String color, String style)
    • setRightBorder

      public Td setRightBorder(int rows, int cols, int width, String color, String style)
    • setRightBorder

      public Td setRightBorder(int rows, int cols, double width, String color, String style)
    • setTopBorder

      public Td setTopBorder(int rows, int cols, String width, String color, String style)
    • setTopBorder

      public Td setTopBorder(int rows, int cols, int width, String color, String style)
    • setTopBorder

      public Td setTopBorder(int rows, int cols, double width, String color, String style)
    • setBottomBorder

      public Td setBottomBorder(int rows, int cols, String width, String color, String style)
    • setBottomBorder

      public Td setBottomBorder(int rows, int cols, int width, String color, String style)
    • setBottomBorder

      public Td setBottomBorder(int rows, int cols, double width, String color, String style)
    • setTl2brBorder

      public Td setTl2brBorder(int rows, int cols, String width, String color, String style)
    • setTl2brBorder

      public Td setTl2brBorder(int rows, int cols, int width, String color, String style)
    • setTl2brBorder

      public Td setTl2brBorder(int rows, int cols, double width, String color, String style)
    • setTr2blBorder

      public Td setTr2blBorder(int rows, int cols, String width, String color, String style)
    • setTr2blBorder

      public Td setTr2blBorder(int rows, int cols, int width, String color, String style)
    • setTr2blBorder

      public Td setTr2blBorder(int rows, int cols, double width, String color, String style)
    • setBorder

      public Td setBorder(int rows, int cols, String side, String width, String color, String style)
    • setBorder

      public Td setBorder(int rows, int cols, String side, int width, String color, String style)
    • setBorder

      public Td setBorder(int rows, int cols, String side, double width, String color, String style)
    • setColor

      public Td setColor(int rows, int cols, String color)
    • setFont

      public Td setFont(int rows, int cols, String weight, String eastAsia, String ascii, String hint)
    • setFontSize

      public Td setFontSize(int rows, int cols, String weight)
    • setFontWeight

      public Td setFontWeight(int rows, int cols, String weight)
    • setFontFamily

      public Td setFontFamily(int rows, int cols, String font)
    • setAlign

      public Td setAlign(int rows, int cols, String align)
      设置文本水平对齐方式
      参数:
      rows - rows
      cols - cols
      align - left center right
      返回:
      Td
    • setVerticalAlign

      public Td setVerticalAlign(int rows, int cols, String align)
      设置文本垂直对齐方式
      参数:
      rows - rows
      cols - cols
      align - top middle|center bottom
      返回:
      td
    • setBackgroundColor

      public Td setBackgroundColor(int rows, int cols, String color)
      背景色
      参数:
      rows - rows
      cols - cols
      color - 颜色
      返回:
      Td
    • removeStyle

      public Td removeStyle(int rows, int cols)
      清除样式
      参数:
      rows - rows
      cols - cols
      返回:
      td
    • removeBackgroundColor

      public Td removeBackgroundColor(int rows, int cols)
      清除背景色
      参数:
      rows - rows
      cols - cols
      返回:
      td
    • removeColor

      public Td removeColor(int rows, int cols)
      清除颜色
      参数:
      rows - rows
      cols - cols
      返回:
      Td
    • setBold

      public Td setBold(int rows, int cols, boolean bold)
      粗体
      参数:
      rows - rows
      cols - cols
      bold - 是否
      返回:
      Td
    • setBold

      public Td setBold(int rows, int cols)
    • setUnderline

      public Td setUnderline(int rows, int cols, boolean underline)
      下划线
      参数:
      rows - rows
      cols - cols
      underline - 是否
      返回:
      Td
    • setUnderline

      public Td setUnderline(int rows, int cols)
    • setStrike

      public Td setStrike(int rows, int cols, boolean strike)
      删除线
      参数:
      rows - rows
      cols - cols
      strike - 是否
      返回:
      Td
    • setStrike

      public Td setStrike(int rows, int cols)
    • setDelete

      public Td setDelete(int rows, int cols)
    • setDelete

      public Td setDelete(int rows, int cols, boolean strike)
    • setItalic

      public Td setItalic(int rows, int cols, boolean italic)
      斜体
      参数:
      rows - rows
      cols - cols
      italic - 是否
      返回:
      Td
    • setItalic

      public Td setItalic(int rows, int cols)
    • setLineHeight

      public Td setLineHeight(int rows, int cols, String height)
      设置行高
      参数:
      rows - rows
      cols - cols
      height - pt/px/cm
      返回:
      Td
    • setLineHeight

      public Td setLineHeight(int rows, int cols, int height)
    • setLineHeight

      public Td setLineHeight(int rows, int cols, double height)
    • setColspan

      public Td setColspan(int rows, int cols, int colspan)
    • setRowspan

      public Td setRowspan(int rows, int cols, int rowspan)
    • setPadding

      public Td setPadding(int rows, int cols, String padding)
    • setPadding

      public Td setPadding(int rows, int cols, int padding)
    • setPadding

      public Td setPadding(int rows, int cols, double padding)
    • setBottomPadding

      public Td setBottomPadding(int rows, int cols, String padding)
    • setBottomPadding

      public Td setBottomPadding(int rows, int cols, int padding)
    • setBottomPadding

      public Td setBottomPadding(int rows, int cols, double padding)
    • setTopPadding

      public Td setTopPadding(int rows, int cols, String padding)
    • setTopPadding

      public Td setTopPadding(int rows, int cols, int padding)
    • setTopPadding

      public Td setTopPadding(int rows, int cols, double padding)
    • setRightPadding

      public Td setRightPadding(int rows, int cols, String padding)
    • setRightPadding

      public Td setRightPadding(int rows, int cols, int padding)
    • setRightPadding

      public Td setRightPadding(int rows, int cols, double padding)
    • setLeftPadding

      public Td setLeftPadding(int rows, int cols, String padding)
    • setLeftPadding

      public Td setLeftPadding(int rows, int cols, int padding)
    • setLeftPadding

      public Td setLeftPadding(int rows, int cols, double padding)
    • setPadding

      public Td setPadding(int rows, int cols, String side, String padding)
    • setPadding

      public Td setPadding(int rows, int cols, String side, int padding)
    • setPadding

      public Td setPadding(int rows, int cols, String side, double padding)