Reply to comment

a few answers

There are many options to set font styles and colors in various places of a HTML page, but this question is more about HTML in general than HTML.py itself. Look for "html font" and "html css" in your favorite search engine, there are many useful tutorials to start with.

You may use styles in HTML.py objects when they have a "style" attribute, or else using the "attribs" attribute. For example:

a_list = ['john', 'paul', 'jack']
htmlcode = HTML.list(a_list, attribs={'style': 'font-family: Helvetica, Arial, sans-serif'})

To answer your second question, you may add a style attribute to a list so that it is centered:

htmlcode = HTML.list(a_list, attribs={'style': 'text-align: center'})

To create links which point to other sections in the same page, just use anchors with a name attribute, and then links such as "#name". Example:

<a name="section1">SECTION 1</a>
...
<a href="#section1">link to section 1</a>

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <b> <address> <blockquote> <br> <caption> <center> <code> <dd> <del> <div> <dl> <dt> <em> <font> <h2> <h3> <h4> <h5> <h6> <hr> <i> <img> <li> <ol> <p> <pre> <span> <strong> <sub> <sup> <table> <tbody> <td> <tfoot> <th> <thead> <tr> <u> <ul> <tr>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].
  • Use [toc list: ol; title: Table of Contents; minlevel: 2; maxlevel: 3; attachments: yes;] to insert a mediawiki style collapsible table of contents. All the arguments are optional.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.