INNER CODE UNIT · Python

make_html

fralau/mkdocs-macros-plugin · mkdocs_macros/context.py:111

def make_html(rows, header=[], tb_class='macros-tb'):
    "Produce an HTML table"
    font_color = "#000000"  # black
    back_color = "#F0FFFF"  # light blue
    grid_color = "#DCDCDC"
    padding = "5px"
    style = f"color:{font_color}; border:1px solid {grid_color}; padding: {padding}"
    templ = Template("""
<table class="{{ tb_class }}" style="background-color: {{ back_color}}; {{ style }}">
    {% for item in header %}
    <th style="{{ style }}">{{ item }}</th>
    {% endfor %}
    {% for row in rows %}
        <tr>
        {% for item in row %}
            <td style="vertical-align:top; {{ style }}">{{ item }}</td>
        {% endfor %}
        </tr>

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…