Configuring Tables

There are standard CSS properties used to indicate what elements are tables, table rows and table cells. What CSS is missing is the possibility to indicate the cell spanning, row separators or the column widths. Oxygen XML Editor offers support for adding extensions to solve these problems.

The table in this example is a simple one. The header must be formatted in a different way than the ordinary rows, so it will have a background color.

table{
    display:table;
    border:1px solid navy;
    margin:1em;
    max-width:1000px;
    min-width:150px;
}

table[width]{
  width:attr(width, length);
}

tr, header{
    display:table-row;
}

header{
    background-color: silver;
    color:inherit
}

td{
  display:table-cell;
  border:1px solid navy;
  padding:1em;
}

Since in the schema, the td tag has the attributes row_span and column_span that are not automatically recognized by Oxygen XML Editor, a Java extension will be implemented that will provide information about the cell spanning. See the section Configuring a Table Cell Span Provider.

The column widths are specified by the attributes width of the elements customcol that are not automatically recognized by Oxygen XML Editor. It is necessary to implement a Java extension that will provide information about the column widths. For more information, see Configuring a Table Column Width Provider.

The table from our example does not make use of the attributes colsep and rowsep (which are automatically recognized) but we still want the rows to be separated by horizontal lines. It is necessary to implement a Java extension that will provide information about the row and column separators. For more information, see Configuring a Table Cell Row and Column Separator Provider.

Was this helpful?