我在css中创建使用counter
属性的页码,试图将其放在页面的末尾,我需要使用 pure css
这是我的CSS:
@media print {
table.break {
page-break-after: left;
}
body {
counter-reset: table;
}
table::after {
counter-increment: table;
content: "page"" "counter(table);
}
.no-print, .no-print * {
display: none;
}
}
答案 0 :(得分:0)
public class MySoftAssert extends Assertion
{
// LinkedHashMap to preserve the order
private Map<AssertionError, IAssert> m_errors = Maps.newLinkedHashMap();
@Override
public void executeAssert(IAssert a) {
try {
a.doAssert();
} catch(AssertionError ex) {
onAssertFailure(a, ex);
m_errors.put(ex, a);
}
}
public void assertAll() {
if (! m_errors.isEmpty()) {
StringBuilder sb = new StringBuilder("The following asserts failed:\n");
boolean first = true;
for (Map.Entry<AssertionError, IAssert> ae : m_errors.entrySet()) {
if (first) {
first = false;
} else {
sb.append(", ");
}
sb.append(ae.getKey().getMessage());
}
throw new AssertionError(sb.toString());
}
}
}
此规则将生成页面页脚,例如&#34; Page 1 of 89&#34;。
了解更多信息