Table Line Thickness

View: New views
6 Messages — Rating Filter:   Alert me  

Table Line Thickness

by DeanNelson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello everyone,
 
Is there a way to control the thickness of the border of each table separately? The common parameter only applies to ALL tables.
 
Maybe an additional PI?
 
Thanks
Dean Nelson

Re: Table Line Thickness

by Kathleen Mattson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Dean-
The answer depends on what output you are aiming for. If your output is HTML, then use separate sections/refsects or IDs so that your HTML will include a way to identify the tables so you can refer to them in your CSS. I'm not familiar with other DocBook output so can't speak to that.


DeanNelson@... wrote:
Hello everyone,
 
Is there a way to control the thickness of the border of each table separately? The common parameter only applies to ALL tables.
 
Maybe an additional PI?
 
Thanks
Dean Nelson

-- 
Kathleen Mattson
www.millermattson.com
kathleen@...
Beaverton, Oregon USA
503-690-4351

Re: Table Line Thickness

by Bob Stayton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Dean,
You could do it with a processing instruction, a tabstyle attribute is more appropriate. A tabstyle can be put on a table or informaltable element to indicate to the stylesheet that different styling is required. 
 
If you go with tabstyle, you can call a utility template named 'tabstyle' that  returns the value of the attribute for the current table.  The tabstyle template is described here:
 
To customize the frame borders, you would copy and edit the template named table.frame in fo/table.xsl to use an xsl:choose statement to select the frame thickness.  An example of using xsl:choose with tabstyle for table cell properties is shown here:
 
 
In the table.frame template, you could do that once at the top of the template to fill a variable, and then use that variable in place of $table.frame.border.thickness in the long set of frame choices that follow:
 
  <xsl:variable name="tabstyle">
    <xsl:call-template name="tabstyle"/>
  </xsl:variable>
 
  <xsl:variable name="frame.thickness">
    <xsl:choose>
      <xsl:when test="$tabstyle='thickborder'">2pt</xsl:when>
      <xsl:when test="$tabstyle='verythickborder'">4pt</xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$table.frame.border.thickness"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
 
And then replace all other instances in the template of $table.frame.border.thickness with $frame.thickness.
 
If you need to also change the rowsep and colsep (cell borders), then customize the template named 'border' in fo/table.xsl with the same technique.
 
Bob Stayton
Sagehill Enterprises
bobs@...
 
 
----- Original Message -----
Sent: Thursday, September 03, 2009 5:34 PM
Subject: [docbook-apps] Table Line Thickness

Hello everyone,
 
Is there a way to control the thickness of the border of each table separately? The common parameter only applies to ALL tables.
 
Maybe an additional PI?
 
Thanks
Dean Nelson

Re: Table Line Thickness

by DeanNelson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Great - Thanks Bob.
 
This all came about when I needed to render a table in PDF that had no borders, but had one cell on the bottom of the table that needed a bottom line, but I could not render it because the "rowsep" does not work on the bottom cell because the outer table line would overwrite it.
 
Sooo... I decided to try to render that particular table a bit different, hence the question. But since I got you on the line, wouldn't it make sense to allow a "rowsep" on a cell when the table has a frame="none" ?
 
Thanks,
Dean Nelson
 
 
 
In a message dated 09/05/09 16:26:20 Pacific Daylight Time, bobs@... writes:
Hi Dean,
You could do it with a processing instruction, a tabstyle attribute is more appropriate. A tabstyle can be put on a table or informaltable element to indicate to the stylesheet that different styling is required. 
 
If you go with tabstyle, you can call a utility template named 'tabstyle' that  returns the value of the attribute for the current table.  The tabstyle template is described here:
 
To customize the frame borders, you would copy and edit the template named table.frame in fo/table.xsl to use an xsl:choose statement to select the frame thickness.  An example of using xsl:choose with tabstyle for table cell properties is shown here:
 
 
In the table.frame template, you could do that once at the top of the template to fill a variable, and then use that variable in place of $table.frame.border.thickness in the long set of frame choices that follow:
 
  <xsl:variable name="tabstyle">
    <xsl:call-template name="tabstyle"/>
  </xsl:variable>
 
  <xsl:variable name="frame.thickness">
    <xsl:choose>
      <xsl:when test="$tabstyle='thickborder'">2pt</xsl:when>
      <xsl:when test="$tabstyle='verythickborder'">4pt</xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$table.frame.border.thickness"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
 
And then replace all other instances in the template of $table.frame.border.thickness with $frame.thickness.
 
If you need to also change the rowsep and colsep (cell borders), then customize the template named 'border' in fo/table.xsl with the same technique.
 
Bob Stayton
Sagehill Enterprises
bobs@...
 
 
----- Original Message -----
Sent: Thursday, September 03, 2009 5:34 PM
Subject: [docbook-apps] Table Line Thickness

Hello everyone,
 
Is there a way to control the thickness of the border of each table separately? The common parameter only applies to ALL tables.
 
Maybe an additional PI?
 
Thanks
Dean Nelson
 

Re: Table Line Thickness

by Bob Stayton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Dean,
You said "wouldn't it make sense to allow a "rowsep" on a cell when the table has a frame="none" ?"
 
It does make sense, but DocBook tries to adhere as closely as possible to the CALS table standard, and that would require a change to the standard, which explicitly says the rowsep on the last row is to be ignored.
 
Bob Stayton
Sagehill Enterprises
bobs@...
 
 
----- Original Message -----
Sent: Monday, September 07, 2009 7:52 PM
Subject: Re: [docbook-apps] Table Line Thickness

Great - Thanks Bob.
 
This all came about when I needed to render a table in PDF that had no borders, but had one cell on the bottom of the table that needed a bottom line, but I could not render it because the "rowsep" does not work on the bottom cell because the outer table line would overwrite it.
 
Sooo... I decided to try to render that particular table a bit different, hence the question. But since I got you on the line, wouldn't it make sense to allow a "rowsep" on a cell when the table has a frame="none" ?
 
Thanks,
Dean Nelson
 
 
 
In a message dated 09/05/09 16:26:20 Pacific Daylight Time, bobs@... writes:
Hi Dean,
You could do it with a processing instruction, a tabstyle attribute is more appropriate. A tabstyle can be put on a table or informaltable element to indicate to the stylesheet that different styling is required. 
 
If you go with tabstyle, you can call a utility template named 'tabstyle' that  returns the value of the attribute for the current table.  The tabstyle template is described here:
 
To customize the frame borders, you would copy and edit the template named table.frame in fo/table.xsl to use an xsl:choose statement to select the frame thickness.  An example of using xsl:choose with tabstyle for table cell properties is shown here:
 
 
In the table.frame template, you could do that once at the top of the template to fill a variable, and then use that variable in place of $table.frame.border.thickness in the long set of frame choices that follow:
 
  <xsl:variable name="tabstyle">
    <xsl:call-template name="tabstyle"/>
  </xsl:variable>
 
  <xsl:variable name="frame.thickness">
    <xsl:choose>
      <xsl:when test="$tabstyle='thickborder'">2pt</xsl:when>
      <xsl:when test="$tabstyle='verythickborder'">4pt</xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$table.frame.border.thickness"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
 
And then replace all other instances in the template of $table.frame.border.thickness with $frame.thickness.
 
If you need to also change the rowsep and colsep (cell borders), then customize the template named 'border' in fo/table.xsl with the same technique.
 
Bob Stayton
Sagehill Enterprises
bobs@...
 
 
----- Original Message -----
Sent: Thursday, September 03, 2009 5:34 PM
Subject: [docbook-apps] Table Line Thickness

Hello everyone,
 
Is there a way to control the thickness of the border of each table separately? The common parameter only applies to ALL tables.
 
Maybe an additional PI?
 
Thanks
Dean Nelson
 

Parent Message unknown Re: Table Line Thickness

by DeanNelson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
(reposting to group)
 
Hmm, is there any way around this other than globally disabling that feature? Maybe if I added another tiny row to the table so it can have a bottom line (which is kind of cheesy) or is there a better way? I really need this type of capability - but just on one really weird table.
 
Dean
 
 
In a message dated 9/11/2009 9:27:11 A.M. Pacific Daylight Time, bobs@... writes:
Hi Dean,
You said "wouldn't it make sense to allow a "rowsep" on a cell when the table has a frame="none" ?"
 
It does make sense, but DocBook tries to adhere as closely as possible to the CALS table standard, and that would require a change to the standard, which explicitly says the rowsep on the last row is to be ignored.
 
Bob Stayton
Sagehill Enterprises
bobs@...
 
 
----- Original Message -----
Sent: Monday, September 07, 2009 7:52 PM
Subject: Re: [docbook-apps] Table Line Thickness

Great - Thanks Bob.
 
This all came about when I needed to render a table in PDF that had no borders, but had one cell on the bottom of the table that needed a bottom line, but I could not render it because the "rowsep" does not work on the bottom cell because the outer table line would overwrite it.
 
Sooo... I decided to try to render that particular table a bit different, hence the question. But since I got you on the line, wouldn't it make sense to allow a "rowsep" on a cell when the table has a frame="none" ?
 
Thanks,
Dean Nelson
 
 
 
In a message dated 09/05/09 16:26:20 Pacific Daylight Time, bobs@... writes:
Hi Dean,
You could do it with a processing instruction, a tabstyle attribute is more appropriate. A tabstyle can be put on a table or informaltable element to indicate to the stylesheet that different styling is required. 
 
If you go with tabstyle, you can call a utility template named 'tabstyle' that  returns the value of the attribute for the current table.  The tabstyle template is described here:
 
To customize the frame borders, you would copy and edit the template named table.frame in fo/table.xsl to use an xsl:choose statement to select the frame thickness.  An example of using xsl:choose with tabstyle for table cell properties is shown here:
 
 
In the table.frame template, you could do that once at the top of the template to fill a variable, and then use that variable in place of $table.frame.border.thickness in the long set of frame choices that follow:
 
  <xsl:variable name="tabstyle">
    <xsl:call-template name="tabstyle"/>
  </xsl:variable>
 
  <xsl:variable name="frame.thickness">
    <xsl:choose>
      <xsl:when test="$tabstyle='thickborder'">2pt</xsl:when>
      <xsl:when test="$tabstyle='verythickborder'">4pt</xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$table.frame.border.thickness"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
 
And then replace all other instances in the template of $table.frame.border.thickness with $frame.thickness.
 
If you need to also change the rowsep and colsep (cell borders), then customize the template named 'border' in fo/table.xsl with the same technique.
 
Bob Stayton
Sagehill Enterprises
bobs@...
 
 
----- Original Message -----
Sent: Thursday, September 03, 2009 5:34 PM
Subject: [docbook-apps] Table Line Thickness

Hello everyone,
 
Is there a way to control the thickness of the border of each table separately? The common parameter only applies to ALL tables.
 
Maybe an additional PI?
 
Thanks
Dean Nelson