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

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
rjplano
Propeller Head
Posts: 51
Joined: Tue May 05, 2020 10:08 am

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

Post by rjplano »

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!
SKamprowski
Sr. Propeller Head
Posts: 277
Joined: Fri Feb 13, 2015 8:25 am
Location: Germany

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

Post by SKamprowski »

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)
rjplano
Propeller Head
Posts: 51
Joined: Tue May 05, 2020 10:08 am

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

Post by rjplano »

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.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

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

Post by ChoccieMuffin »

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 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

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

Post by NorthEast »

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).
rjplano
Propeller Head
Posts: 51
Joined: Tue May 05, 2020 10:08 am

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

Post by rjplano »

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: 51
Joined: Tue May 05, 2020 10:08 am

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

Post by rjplano »

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.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

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

Post by NorthEast »

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)
rjplano
Propeller Head
Posts: 51
Joined: Tue May 05, 2020 10:08 am

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

Post by rjplano »

Thanks Dave! I'll give that a try, see if it solves all my border issues.
Post Reply