使用计数器属性时如何将页码放在底部

时间:2015-04-28 10:12:20

标签: c# html css asp.net

我在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;
        }
    }

1 个答案:

答案 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;。

了解更多信息

http://www.princexml.com/doc/page-numbers/

https://stackoverflow.com/a/6109932/4513879