/*
=================================
    HTML and Docbook CALLS tables
=================================
*/

/*
    The caption of the table.
*/
table > caption,
table > info > title,
table > title{ 
    display: table-caption;
    font-weight:bold;
    font-style: italic;
    color: #663300;
    background-color:inherit;
    text-align: left;
    margin-left: 1em;
    margin-right: 1em;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* 
    A Table in a document 
*/
table,
informaltable{
  display: table;
  margin: 1.5ex 0.5ex;
  /*overriden in cals_table.css*/
  border-color: #EFEFEF;
  border-style:solid;
  border-width:1px;
}

/*
  Frame attribute - Specifies how the table is to be framed.
*/
 
/*
     Reset the border.
*/
table[border],
informaltable[border]{
    border-width:attr(border,px);
    border-style:solid;
    border-color:#777777;
}

/*
    Define each border.
    Even if HTML indicates that the framing should not be done if
    there is no border, Docbook is not explicit.
    
    Should be: table[border][frame]
*/
table[frame],
informaltable[frame]{
    border-style:none;
    border-color:#777777;
}

table[frame='above'],
table[frame='top'],
informaltable[frame='above'],
informaltable[frame='top']{
  border-top-style:solid;
}

table[frame='below'],
table[frame='bottom'],
informaltable[frame='below'],
informaltable[frame='bottom']{
  border-bottom-style:solid;
}

table[frame='rhs'],
informaltable[frame='rhs']{
  border-right-style:solid;
}

table[frame='lhs'],
informaltable[frame='lhs']{
  border-left-style:solid;
}

table[frame='vsides'],
table[frame='sides'],
informaltable[frame='vsides'],
informaltable[frame='sides']{
  border-left-style:solid;
  border-right-style:solid;
}

table[frame='hsides'],
table[frame='topbot'],
informal[frame='hsides'],
informal[frame='topbot']{
  border-bottom-style:solid;
  border-top-style:solid;
}

table[frame='box'],
table[frame='border'],
table[frame='all'],
informaltable[frame='box'],
informaltable[frame='border'],
informaltable[frame='all']{
  border-style:solid;
}

/*
  Specifies the presence or absence of the row separator.
  Docbook.
 */
*[rowsep='0'] entry,
*[rowsep='0'] td,
*[rowsep='0'] th{
  border-top-style:none;
  border-bottom-style:none;
}

/*
  Specifies the presence or absence of the column separator.
  Docbook.
*/
*[colsep='0'] entry, 
*[colsep='0'] td, 
*[colsep='0'] th{
  border-left-style:none;
  border-right-style:none;
}


*[align='left']{
   text-align:left;
}
*[align='right']{
   text-align:right;
}
*[align='center']{
   text-align:center;
}
/*
  A wrapper for the main content of a table, or part of a table
 */
tgroup {
  display: table-row-group;
}

tbody {
/* overriden in cals_table.css */
    display:table-row-group;
}

/* 
    A table header consisting of one or more rows 
*/
thead {
  display: table-header-group;
  background-color: #CCEEFF;
  color:#000066;
}

/* 
    A table footer consisting of one or more rows 
*/
tfoot {
  display: table-footer-group;
  font-style:oblique;
  background-color: #DEDEDE;
  color:navy;
}

thead row > entry,
tfoot row > entry,
thead row > td,
tfoot row > td,
thead row > th,
tfoot row > th{
    border-color:black;
}

/*
    Table row.
*/
row,
tr{
    display:table-row;
}

/*
    Table cell.
*/
entry,
td,
th{
    display:table-cell;     
    border-color: #EEEEEE;
    border-style:solid;
    border-width:1px;
    padding:1px;
}


/* 
    entrytbl - A subtable appearing in place of an Entry in a table 
*/
entrytbl {
  display: table;
}


th {
    font-weight:bold;    
}

table[bgcolor],
informaltable[bgcolor],
tr[bgcolor],
td[bgcolor]{
    background-color:attr(bgcolor);
    color:inherit;
}


/*
    The columns are separated.
*/
table[border][rules=cols] > tr > td,
table[border][rules=cols] > tr > th,
table[border][rules=cols] > tbody > tr > td,
table[border][rules=cols] > tbody > tr > th,
table[border][rules=cols] > thead > tr > td,
table[border][rules=cols] > thead > tr > th,
table[border][rules=cols] > tfoot > tr > td,
table[border][rules=cols] > tfoot > tr > th{
    border-left:1px solid #777777;
    border-right:1px solid #777777;
}

/*
    The columns are separated.
*/
table[border][rules=rows] > tr > td,
table[border][rules=rows] > tr > th,
table[border][rules=rows] > tbody > tr > td,
table[border][rules=rows] > tbody > tr > th,
table[border][rules=rows] > thead > tr > td,
table[border][rules=rows] > thead > tr > th,
table[border][rules=rows] > tfoot > tr > td,
table[border][rules=rows] > tfoot > tr > th{
    border-top:1px solid #777777;
    border-bottom:1px solid #777777;
}

/*
    All the columns and rows are separated.
*/
table[border][rules=all] > tr > td,
table[border][rules=all] > tr > th,
table[border][rules=all] > tbody > tr > td,
table[border][rules=all] > tbody > tr > th,
table[border][rules=all] > thead > tr > td,
table[border][rules=all] > thead > tr > th,
table[border][rules=all] > tfoot > tr > td,
table[border][rules=all] > tfoot > tr > th{
    border:1px solid #777777;
}

/*
    None of the columns and rows are separated.
*/
table[border][rules=none] > tr > td,
table[border][rules=none] > tr > th,
table[border][rules=none] > tbody > tr > td,
table[border][rules=none] > tbody > tr > th,
table[border][rules=none] > thead > tr > td,
table[border][rules=none] > thead > tr > th,
table[border][rules=none] > tfoot > tr > td,
table[border][rules=none] > tfoot > tr > th{
    border:1px solid #EEEEEE;
}

/*
========================
    The align with the priority is set to the td, then 
    it follows the one from the row and then the one 
    from the row group.
========================
*/

/*
    HTML tables.
*/


/*
-------
    Bottom
-------
*/

/*Least specific*/
tbody[valign=bottom] > tr > td,
/*TH*/
tbody[valign=bottom] > tr > th,
/* THEAD*/
thead[valign=bottom] > tr > td,
/*TH*/
thead[valign=bottom] > tr > th,
/*TFOOT*/
tfoot[valign=bottom] > tr > td,
/*TH*/
tfoot[valign=bottom] > tr > th
{
    vertical-align:bottom;
}


/*More specific*/
tbody[valign] > tr[valign=bottom] > td,
tbody         > tr[valign=bottom] > td,
/*TH*/
tbody[valign] > tr[valign=bottom] > th,
tbody         > tr[valign=bottom] > th,
/* THEAD */
thead[valign] > tr[valign=bottom] > td,
thead         > tr[valign=bottom] > td,
/*TH*/
thead[valign] > tr[valign=bottom] > th,
thead         > tr[valign=bottom] > th,
/*TFOOT*/
tfoot[valign] > tr[valign=bottom] > td,
tfoot         > tr[valign=bottom] > td,
/*TH*/
tfoot[valign] > tr[valign=bottom] > th,
tfoot         > tr[valign=bottom] > th
{
    vertical-align:bottom;
}

/*Even more specific*/
tbody[valign] > tr[valign] > td[valign=bottom],
tbody         > tr[valign] > td[valign=bottom],
tbody[valign] > tr         > td[valign=bottom],
tbody         > tr         > td[valign=bottom],
/*TH*/
tbody[valign] > tr[valign] > th[valign=bottom],
tbody         > tr[valign] > th[valign=bottom],
tbody[valign] > tr         > th[valign=bottom],
tbody         > tr         > th[valign=bottom],
/* THEAD */
thead[valign] > tr[valign] > td[valign=bottom],
thead         > tr[valign] > td[valign=bottom],
thead[valign] > tr         > td[valign=bottom],
thead         > tr         > td[valign=bottom],
/*TH*/
thead[valign] > tr[valign] > th[valign=bottom],
thead         > tr[valign] > th[valign=bottom],
thead[valign] > tr         > th[valign=bottom],
thead         > tr         > th[valign=bottom],
/*TFOOT*/
tfoot[valign] > tr[valign] > td[valign=bottom],
tfoot         > tr[valign] > td[valign=bottom],
tfoot[valign] > tr         > td[valign=bottom],
tfoot         > tr         > td[valign=bottom],
/*TH*/
tfoot[valign] > tr[valign] > th[valign=bottom],
tfoot         > tr[valign] > th[valign=bottom],
tfoot[valign] > tr         > th[valign=bottom],
tfoot         > tr         > th[valign=bottom]
{
    vertical-align:bottom;
}


/*
-------
    Top
-------
*/

/*Least specific*/
tbody[valign=top] > tr > td,
/*TH*/
tbody[valign=top] > tr > th,
/* THEAD */
thead[valign=top] > tr > td,
/*TH*/
thead[valign=top] > tr > th,
/*TFOOT*/
tfoot[valign=top] > tr > td,
/*TH*/
tfoot[valign=top] > tr > th
{
    vertical-align:top;
}


/*More specific*/
tbody[valign] > tr[valign=top] > td,
tbody         > tr[valign=top] > td,
/*TH*/
tbody[valign] > tr[valign=top] > th,
tbody         > tr[valign=top] > th,
/*THEAD*/
thead[valign] > tr[valign=top] > td,
thead         > tr[valign=top] > td,
/*TH*/
thead[valign] > tr[valign=top] > th,
thead         > tr[valign=top] > th,
/*TFOOT*/
tfoot[valign] > tr[valign=top] > td,
tfoot         > tr[valign=top] > td,
/*TH*/
tfoot[valign] > tr[valign=top] > th,
tfoot         > tr[valign=top] > th
{
    vertical-align:top;
}

/*Even more specific*/
tbody[valign] > tr[valign] > td[valign=top],
tbody         > tr[valign] > td[valign=top],
tbody[valign] > tr         > td[valign=top],
tbody         > tr         > td[valign=top],
/*TH*/
tbody[valign] > tr[valign] > th[valign=top],
tbody         > tr[valign] > th[valign=top],
tbody[valign] > tr         > th[valign=top],
tbody         > tr         > th[valign=top],
/*THEAD*/
thead[valign] > tr[valign] > td[valign=top],
thead         > tr[valign] > td[valign=top],
thead[valign] > tr         > td[valign=top],
thead         > tr         > td[valign=top],
/*TH*/
thead[valign] > tr[valign] > th[valign=top],
thead         > tr[valign] > th[valign=top],
thead[valign] > tr         > th[valign=top],
thead         > tr         > th[valign=top],
/*TFOOT*/
tfoot[valign] > tr[valign] > td[valign=top],
tfoot         > tr[valign] > td[valign=top],
tfoot[valign] > tr         > td[valign=top],
tfoot         > tr         > td[valign=top],
/*TH*/
tfoot[valign] > tr[valign] > th[valign=top],
tfoot         > tr[valign] > th[valign=top],
tfoot[valign] > tr         > th[valign=top],
tfoot         > tr         > th[valign=top]
{
    vertical-align:top;
}


/*
-------
    Middle
-------
*/

/*Least specific*/
tbody[valign=middle] > tr > td,
/*TH*/
tbody[valign=middle] > tr > th,
/*THEAD*/
thead[valign=middle] > tr > td,
/*TH*/
thead[valign=middle] > tr > th,
/*TFOOT*/
tfoot[valign=middle] > tr > td,
/*TH*/
tfoot[valign=middle] > tr > th
{
    vertical-align:middle;
}


/*More specific*/
tbody[valign] > tr[valign=middle] > td,
tbody         > tr[valign=middle] > td,
/*TH*/
tbody[valign] > tr[valign=middle] > th,
tbody         > tr[valign=middle] > th,
/*THEAD*/
thead[valign] > tr[valign=middle] > td,
thead         > tr[valign=middle] > td,
/*TH*/
thead[valign] > tr[valign=middle] > th,
thead         > tr[valign=middle] > th,
/*TFOOT*/
tfoot[valign] > tr[valign=middle] > td,
tfoot         > tr[valign=middle] > td,
/*TH*/
tfoot[valign] > tr[valign=middle] > th,
tfoot         > tr[valign=middle] > th
{
    vertical-align:middle;
}

/*Even more specific*/
tbody[valign] > tr[valign] > td[valign=middle],
tbody         > tr[valign] > td[valign=middle],
tbody[valign] > tr         > td[valign=middle],
tbody         > tr         > td[valign=middle],
/*TH*/
tbody[valign] > tr[valign] > th[valign=middle],
tbody         > tr[valign] > th[valign=middle],
tbody[valign] > tr         > th[valign=middle],
tbody         > tr         > th[valign=middle],
/*THEAD*/
thead[valign] > tr[valign] > td[valign=middle],
thead         > tr[valign] > td[valign=middle],
thead[valign] > tr         > td[valign=middle],
thead         > tr         > td[valign=middle],
/*TH*/
thead[valign] > tr[valign] > th[valign=middle],
thead         > tr[valign] > th[valign=middle],
thead[valign] > tr         > th[valign=middle],
thead         > tr         > th[valign=middle],
/*TFOOT*/
tfoot[valign] > tr[valign] > td[valign=middle],
tfoot         > tr[valign] > td[valign=middle],
tfoot[valign] > tr         > td[valign=middle],
tfoot         > tr         > td[valign=middle],
/*TH*/
tfoot[valign] > tr[valign] > th[valign=middle],
tfoot         > tr[valign] > th[valign=middle],
tfoot[valign] > tr         > th[valign=middle],
tfoot         > tr         > th[valign=middle]
{
    vertical-align:middle;
}

/*
-------
    Baseline
-------
*/

/*Least specific*/
tbody[valign=baseline] > tr > td,
/*TH*/
tbody[valign=baseline] > tr > th,
/*THEAD*/
thead[valign=baseline] > tr > td,
/*TH*/
thead[valign=baseline] > tr > th,
/*TFOOT*/
tfoot[valign=baseline] > tr > td,
/*TH*/
tfoot[valign=baseline] > tr > th
{
    vertical-align:baseline;
}


/*More specific*/
tbody[valign] > tr[valign=baseline] > td,
tbody         > tr[valign=baseline] > td,
/*TH*/
tbody[valign] > tr[valign=baseline] > th,
tbody         > tr[valign=baseline] > th,
/*THEAD*/
thead[valign] > tr[valign=baseline] > td,
thead         > tr[valign=baseline] > td,
/*TH*/
thead[valign] > tr[valign=baseline] > th,
thead         > tr[valign=baseline] > th,
/*TFOOT*/
tfoot[valign] > tr[valign=baseline] > td,
tfoot         > tr[valign=baseline] > td,
/*TH*/
tfoot[valign] > tr[valign=baseline] > th,
tfoot         > tr[valign=baseline] > th
{
    vertical-align:baseline;
}

/*Even more specific*/
tbody[valign] > tr[valign] > td[valign=baseline],
tbody         > tr[valign] > td[valign=baseline],
tbody[valign] > tr         > td[valign=baseline],
tbody         > tr         > td[valign=baseline],
/*TH*/
tbody[valign] > tr[valign] > th[valign=baseline],
tbody         > tr[valign] > th[valign=baseline],
tbody[valign] > tr         > th[valign=baseline],
tbody         > tr         > th[valign=baseline],
/*THEAD*/
thead[valign] > tr[valign] > td[valign=baseline],
thead         > tr[valign] > td[valign=baseline],
thead[valign] > tr         > td[valign=baseline], 
thead         > tr         > td[valign=baseline],
/*TH*/
thead[valign] > tr[valign] > th[valign=baseline],
thead         > tr[valign] > th[valign=baseline],
thead[valign] > tr         > th[valign=baseline],
thead         > tr         > th[valign=baseline],
/*TFOOT*/
tfoot[valign] > tr[valign] > td[valign=baseline],
tfoot         > tr[valign] > td[valign=baseline],
tfoot[valign] > tr         > td[valign=baseline], 
tfoot         > tr         > td[valign=baseline],
/*TH*/
tfoot[valign] > tr[valign] > th[valign=baseline],
tfoot         > tr[valign] > th[valign=baseline],
tfoot[valign] > tr         > th[valign=baseline],
tfoot         > tr         > th[valign=baseline]
{
    vertical-align:baseline;
}


/*
    Docbook CALLS tables.
*/


/*
-------
    Bottom
-------
*/

/*Least specific*/
tbody[valign=bottom] > row > entry{
    vertical-align:bottom;
}


/*More specific*/
tbody[valign] > row[valign=bottom] > entry,
tbody         > row[valign=bottom] > entry{
    vertical-align:bottom;
}

/*Even more specific*/
tbody[valign] > row[valign] > entry[valign=bottom],
tbody         > row[valign] > entry[valign=bottom],
tbody[valign] > row         > entry[valign=bottom],
tbody         > row         > entry[valign=bottom]{
    vertical-align:bottom;
}


/*
-------
    Top
-------
*/

/*Least specific*/
tbody[valign=top] > row > entry{
    vertical-align:top;
}


/*More specific*/
tbody[valign] > row[valign=top] > entry,
tbody         > row[valign=top] > entry{
    vertical-align:top;
}

/*Even more specific*/
tbody[valign] > row[valign] > entry[valign=top],
tbody         > row[valign] > entry[valign=top],
tbody[valign] > row         > entry[valign=top],
tbody         > row         > entry[valign=top]{
    vertical-align:top;
}


/*
-------
    Middle
-------
*/

/*Least specific*/
tbody[valign=middle] > row > entry{
    vertical-align:middle;
}


/*More specific*/
tbody[valign] > row[valign=middle] > entry,
tbody         > row[valign=middle] > entry{
    vertical-align:middle;
}

/*Even more specific*/
tbody[valign] > row[valign] > entry[valign=middle],
tbody         > row[valign] > entry[valign=middle],
tbody[valign] > row         > entry[valign=middle],
tbody         > row         > entry[valign=middle]{
    vertical-align:middle;
}

/*
-------
    Baseline
-------
*/

/*Least specific*/
tbody[valign=baseline] > row > entry{
    vertical-align:baseline;
}


/*More specific*/
tbody[valign] > row[valign=baseline] > entry,
tbody         > row[valign=baseline] > entry{
    vertical-align:baseline;
}

/*Even more specific*/
tbody[valign] > row[valign] > entry[valign=baseline],
tbody         > row[valign] > entry[valign=baseline],
tbody[valign] > row         > entry[valign=baseline],
tbody         > row         > entry[valign=baseline]{
    vertical-align:baseline;
}


colgroup {
    display:block;    
}

colspec, col{
    text-align:left;
    display:block;
    color:#444444;
    background-color:inherit;
    margin:0.2em;
    padding:2px;
    font-family:monospace;
    font-size:small;    
}

colspec:before{
    content:"colspec";    
}

colspec:after{
    content:"[colname: " attr(colname) ", column: " attr(colnum) ", colwidth: " attr(colwidth) "]";    
}



col:before{
    content:"col";
}
col:after{
    content:"[title: " attr(title) ", span: " attr(span) ", style: " attr(style) "]";    
}

