Top and bottom borders in just one column of a table?

This forum is for all Flare issues related to styles, stylesheets and XML.

Top and bottom borders in just one column of a table?

Postby rjplano on Thu Apr 15, 2021 5:15 pm

I have a PDF output document that contains a two-column table. I want borders between the rows in the second column, but not the first. Right now I'm applying a td style to the cells in the second column that specify the border parameters. This works OK but it would be nice if it was more automatic. I can't see any way to use a Table Style to do this as I can only specify borders/separators for the whole row. It would also be useful if the border was not applied if the row goes across a page break. I just want a border only between the rows, not within the rows.

Thanks!
rjplano
Propeller Head
 
Posts: 35
Joined: Tue May 05, 2020 10:08 am

Re: Top and bottom borders in just one column of a table?

Postby SKamprowski on Wed Apr 21, 2021 2:38 am

Hello,

if you look at a table style you may find columns. If you only have one column in your style you may add a second one and specify its seperator.
You do not have the required permissions to view the files attached to this post.
Kind regards,
Sabine Kamprowski
DocToHelp MVP (by ComponentOne)
SKamprowski
Sr. Propeller Head
 
Posts: 273
Joined: Fri Feb 13, 2015 8:25 am
Location: Germany

Re: Top and bottom borders in just one column of a table?

Postby rjplano on Wed Apr 21, 2021 9:55 am

Thanks for the suggestion but the column separators are vertical, not horizontal, so they separate one column from another, not the rows in a single column.
rjplano
Propeller Head
 
Posts: 35
Joined: Tue May 05, 2020 10:08 am

Re: Top and bottom borders in just one column of a table?

Postby ChoccieMuffin on Tue Apr 27, 2021 2:26 am

You may be able to create a custom row, which puts borders on all columns except the first?
Started as a newbie with Flare 6.1, now using Flare 2019r1 and 2020.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
ChoccieMuffin
Senior Propellus Maximus
 
Posts: 2462
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Top and bottom borders in just one column of a table?

Postby Dave Lee on Tue Apr 27, 2021 5:38 am

You can't do this using table stylesheet, as you can only format a whole row or a whole column.

You could do it using some CSS, for example this will add a red bottom border to cells in the 3rd column:

Code: Select all
table.TableStyle-TestTable tr td:nth-child(3)
{
   border-bottom: 1px solid red;
}


Adjust TestTable to your table style name (which has a class name like .TableStyle-TestTable), and set the column number in nth-child(3).
Dave Lee
Master Propellus Maximus
 
Posts: 5961
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Top and bottom borders in just one column of a table?

Postby rjplano on Tue Apr 27, 2021 10:40 am

Thanks, Dave, that's a pretty cool solution. I gave it a try and unfortunately it doesn't quite work in my situation. First, I have tables inside the main table and the CSS puts puts borders on the (in my case) second column of the enclosed tables as well. I can probably fix that with a bit more CSS, though. Second, if a cell crosses a page break, the border is placed at the bottom of the page, as well as at the actual bottom of the cell, dividing the cell where I don't want it to be divided.
rjplano
Propeller Head
 
Posts: 35
Joined: Tue May 05, 2020 10:08 am

Re: Top and bottom borders in just one column of a table?

Postby rjplano on Tue Apr 27, 2021 10:55 am

And ignore that last problem, where the border is added to the cell when cell goes across a page break. I just realized what the "Hide bottom ruling when table crosses a page break:" setting in the Table Properties does.
rjplano
Propeller Head
 
Posts: 35
Joined: Tue May 05, 2020 10:08 am

Re: Top and bottom borders in just one column of a table?

Postby Dave Lee on Wed Apr 28, 2021 12:18 am

rjplano wrote:Thanks, Dave, that's a pretty cool solution. I gave it a try and unfortunately it doesn't quite work in my situation. First, I have tables inside the main table and the CSS puts puts borders on the (in my case) second column of the enclosed tables as well. I can probably fix that with a bit more CSS, though. Second, if a cell crosses a page break, the border is placed at the bottom of the page, as well as at the actual bottom of the cell, dividing the cell where I don't want it to be divided.


Yes, just make the CSS more specific.

Code: Select all
table.TableStyle-TestTable > tbody > tr > td:nth-child(3)
Dave Lee
Master Propellus Maximus
 
Posts: 5961
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Top and bottom borders in just one column of a table?

Postby rjplano on Wed Apr 28, 2021 11:05 am

Thanks Dave! I'll give that a try, see if it solves all my border issues.
rjplano
Propeller Head
 
Posts: 35
Joined: Tue May 05, 2020 10:08 am


Return to Styles, Stylesheets and XML

Who is online

Users browsing this forum: No registered users and 6 guests