Thank you very much!!! This was exactly what I wanted. In fact, I was
grappling with the task of displaying a header row with the column names,
before this mail.

One more doubt is that if a table is inserted in the body (somewhere in a
section, while using docbook), you get a thin border, but for this "revision
history" table, the border is thick. I tried many variations with the
border-width attribute, but still the border remains thick.

Any ideas?

Snapshot of a simple table attached...


----- Original Message -----
From: Hussein Shafie <[email protected]>
To: B.S.Navin <bsnavin at gmail.com>
Cc: <xmleditor-support at xmlmind.com>
Sent: Tuesday, April 12, 2005 2:35 PM
Subject: Re: [XXE] Tables using CSS not formattted correctly


> B.S.Navin wrote:
> > I am using XXE Standard Edition for editing some docbook documents. I
> > had a revision history in the docbook document (shown below):
> >
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
> >   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd";>
> > <article>
> >   <articleinfo>
> >     <title>Test Doc</title>
> >
> >     <revhistory>
> >     <revision>
> >     <revnumber>0.1</revnumber>
> >     <date>11 April, 2005</date>
> >     <authorinitials>XYZ</authorinitials>
> >     <revremark>Initial Draft</revremark>
> >     </revision>
> >     <revision>
> >     <revnumber>0.2</revnumber>
> >     <date>12 April, 2005</date>
> >     <authorinitials>XYZ</authorinitials>
> >     <revremark>After review comments</revremark>
> >     </revision>
> >     </revhistory>
> >   </articleinfo>
> >
> >   <section>
> >     <title></title>
> >     <para></para>
> >   </section>
> > </article>
> >
> > I wanted the revision history displayed as a table in the XXE view. So
> > I created the following CSS:
> >
> > @import url(xxe-config:docbook/css/docbook.css);
> >
> > revhistory:before {
> > content: "Revision History";
> > }
> >
> > revhistory {
> > display: table;
> >     border-style: solid;
> >     border-width: 1;
> >     margin: 1.33ex 0;
> > }
> >
> > revision:before {
> > display: inline;
> > content: "";
> > }
> >
> > revision {
> >     display: table-row;
> > }
> >
> > revnumber, revision date, revision authorinitials, revremark,
revdescription {
> >     display: table-cell;
> >     border-style: solid;
> >     border-width: 1;
> > font-weight: normal;
> >     padding: 2;
> > }
> >
> > revnumber:after, revision date:after, revision authorinitials:after {
> >     content: "";
> > }
> >
> > The table gets created, but each of the children of the "revision" tag
> > is displayed in a new row, although I have given the display type for
> > the children as "table-cell".
> >
> > Any ideas as to why this is happening & how I can solve this?
>
> The problem comes from this CSS rule (found in
> <XXE_install_dir>/config/docbook/css/docbook2.imp) which applies to the
> revhistory found in your example (rev.docb).
>
> ---
> articleinfo > * {
>      display: block;
>      text-align: left; /* Reset paragraph styles */
>      font: normal normal 1em sans-serif;
>      color: black;
>      margin-left: 18ex;
>      margin-right: 0;
>      margin-top: 1.33ex;
>      margin-bottom: 1.33ex;
> }
> ---
>
> There is probably a bug in the CSS engine because, in XXE, this rule
> seems to have a specificity (or a rank?) higher than the one of:
>
> ---
> revhistory {
>      display: table;
>      ...
> }
> ---
>
> The workaround is to artificially increase the specifity of your rule:
>
> ---
> articleinfo > revhistory {
>      display: table;
>      ...
> }
> ---
>
> See attached files for a working example. Rev.css (displayed in rev.gif)
> contains an interesting variation on what you did.
>


----------------------------------------------------------------------------
----


> <?xml version="1.0" encoding="ISO-8859-1"?>
> <?xml-stylesheet type="text/css" href="rev.css"?>
> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
> "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd";>
> <article>
>   <articleinfo>
>     <title>Test Doc</title>
>
>     <revhistory>
>       <revision>
>         <revnumber>0.1</revnumber>
>
>         <date>11 April, 2005</date>
>
>         <authorinitials>XYZ</authorinitials>
>
>         <revremark>Initial Draft</revremark>
>       </revision>
>
>       <revision>
>         <revnumber>0.2</revnumber>
>
>         <date>12 April, 2005</date>
>
>         <authorinitials>XYZ</authorinitials>
>
>         <revremark>After review comments</revremark>
>       </revision>
>     </revhistory>
>   </articleinfo>
>
>   <section>
>     <title></title>
>
>     <para></para>
>   </section>
> </article>


----------------------------------------------------------------------------
----


> @import url(xxe-config:docbook/css/docbook.css);
>
> articleinfo > revhistory {
>     display: table;
>     border-style: solid;
>     border-width: 1;
>     margin-left: 0;
>     margin-right: 0;
>     margin-top: 0.25ex;
>     margin-bottom: 1.33ex;
> }
>
> /*
> revhistory:before {
>     content: "Revision History";
>     display: block;
>     margin-top: 1.33ex;
> }
> */
>
> revhistory:before {
>     display: table-row;
>     content: rows(row(cell("Revision History"), column-span, 5),
>                   row(cell("Number"),
>                       cell("Date"),
>                       cell("Author"),
>                       cell("Description", column-span, 2)),
>                  border-style, solid,
>                  border-width, 1,
>                  border-top-color, black,
>                  border-bottom-color, black,
>                  border-left-color, black,
>                  border-right-color, black,
>                  font-weight, bold,
>                  font-size, normal,
>                  color, black,
>                  background-color, #E0E0E0,
>          padding-top, 2,
>          padding-bottom, 2,
>          padding-left, 2,
>          padding-right, 2);
>     margin-top: 1.33ex;
> }
>
> revision:before {
>     content: "";
> }
>
> revision {
>     display: table-row;
> }
>
> revnumber,
> revision > date,
> revision > authorinitials,
> revremark,
> revdescription {
>     display: table-cell;
>     border-style: solid;
>     border-width: 1;
>     font-weight: normal;
>     padding: 2;
> }
>
> revremark,
> revdescription {
>     column-span: 2;
> }
>
> revnumber:after,
> revision > date:after,
> revision > authorinitials:after {
>     content: "";
> }
>


----------------------------------------------------------------------------
----




-------------- next part --------------
A non-text attachment was scrubbed...
Name: thin-border-table.gif
Type: image/gif
Size: 4796 bytes
Desc: not available
Url : 
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20050417/26dc9e33/attachment.gif
 

Reply via email to