def html_page_context(app, pagename, templatename, context, doctree):
    """
    Handler for the html-page-context event. This handler is used to inject
    a CSS declaration into the generated page.
    """
    style = """
        .rst-content dl dd .datatable { line-height: normal; }
        .rst-content .datatable table.frame,
        .datatable table.frame {
            border: none;
            border-collapse: collapse;
            border-spacing: 0;
            color: #222;
            cursor: default;
            font-size: 12px;
            margin: 0 !important;
        }
        .datatable table.frame thead {
            border-bottom: none;
            vertical-align: bottom;
        }
        .datatable table.frame thead tr.coltypes th {
            color: #FFFFFF;
            line-height: 6px;
            padding: 0 0.5em;
        }
        .datatable .bool { background: #DDDD99; }
        .datatable .obj  { background: #565656; }
        .datatable .int  { background: #5D9E5D; }
        .datatable .real { background: #4040CC; }
        .datatable .str  { background: #CC4040; }
        .datatable table.frame td,
        .datatable table.frame thead th,
        .datatable table.frame tr {
            border: none;
            max-width: none;
            padding: 0.5em 0.5em;
            text-align: right;
            vertical-align: middle;
        }
        .datatable table.frame thead tr th:nth-child(2) {
            padding-left: 12px;
        }
        .datatable table.frame tbody tr:nth-child(even) {
            background-color: #F5F5F5;
        }
        .datatable table.frame.docutils tbody tr:nth-child(odd) td {
            background-color: #FFFFFF;
        }
        .datatable table.frame td.row_index {
            color: rgba(0, 0, 0, 0.38);
            background: #EEEEEE;
            font-size: 9px;
            border-right: 1px solid #BDBDBD;
        }
        .datatable table.frame tr.coltypes td.row_index {
            background: #BDBDBD;
        }
        .datatable table.frame td.hellipsis {
            color: #E0E0E0;
        }
        .datatable table.frame td.vellipsis {
            background: #FFFFFF;
            color: #E0E0E0;
        }
        .datatable table.frame td.na {
            color: #E0E0E0;
            font-size: 80%;
        }
        .datatable .footer {
            font-size: 9px;
        }
        .datatable .footer .frame_dimensions {
            background: #EEEEEE;
            border-top: 1px solid #BDBDBD;
            color: rgba(0, 0, 0, 0.38);
            display: inline-block;
            opacity: 0.6;
            padding: 1px 10px 1px 5px;
        }
    """
    context['body'] = ('<style type="text/css" id="dtcss">' + style +
        '</style>\n' + context.get('body', ''))
