def write_colspecs(writer):
    """

    Copied from docutils.writers.html4css1.HTMLTranslator,
    except the parameter to writer.body.append function.
    """
    width = 0
    for node in writer.colspecs:
        width += node['colwidth']
    for node in writer.colspecs:
        colwidth = int(node['colwidth'] * 100.0 / width + 0.5)
        writer.body.append('<col class="width-%d%%" />\n' % colwidth)
    writer.colspecs = []
