Forum Bugs

Unwanted borders on a page-spanning div

davidp
I want a border at the top and the bottom of a <div> containing text. I'm finding that if the <div> happens to span across multiple pages I get unwanted borders.

+-----------------+
| The quick brown |
| fox jumps over  |
+-----------------+

<-- page break -->

+-----------------+
| the lazy dog.   |
+-----------------+


What I want:
+-----------------+
| The quick brown |
| fox jumps over  |


<-- page break -->


| the lazy dog.   |
+-----------------+


Otherwise, to the reader, it looks like two separate blocks of text.

Is there any easy way to achieve this?
mikeday
Not at the moment, we will need to support the new CSS3 border-break property in order to achieve this. I've added it to the roadmap for inclusion in a future release.
David J Prokopetz
Would border-break also apply to tables, if implemented? I've found that divs and tables currently display different behaviour: if a div with a border crosses a page break, the borders are "closed" (creating the appearance of two separate boxes), while if a table with a border crosses a page break, the borders are "open" (i.e., you just get the cell border against the break). It would be handy to be able to specify, as non-closed borders can make tables with running headers and footers look a bit strange.
mikeday
Yes, we will apply this property to tables as well. However, at the moment table borders should be repeated at the end of a page if the break occurs between table rows, not in the middle of a row.
David J Prokopetz
mikeday wrote:
Yes, we will apply this property to tables as well. However, at the moment table borders should be repeated at the end of a page if the break occurs between table rows, not in the middle of a row.

I'm afraid that's not how it's working for me. Observe:

http://www.penguinking.com/files/html/table-border-example.html

http://www.penguinking.com/files/pdf/table-border-example.pdf

Interestingly, the problem can be resolved by inserting a "dummy" thead or tfoot into an affected table, containing a single row with no cells in it (e.g., <tfoot><tr></tr></tfoot>); this causes the affected border to render as expected. Perhaps proper border closing for page-spanning tables has unintentionally been made dependent on the presence of a well-formed thead and/or tfoot element?
mikeday
This is a bug specific to collapsing borders, which will be fixed in 7.1. Sorry for the inconvenience.
mikeday
Today we have released Prince 7.1, which includes support for the border-break property.