[Twisted-Python] Woven, using microdom.lmx, and trying to use style sheets

Donovan Preston dp at twistedmatrix.com
Wed Oct 29 20:11:05 MST 2003


On Oct 29, 2003, at 6:37 PM, Hegedus, Matthew S wrote:

>        t = d.table(_class='exerciseTableClass')
>        t.tr(_class='tableHeadingClass')
>
>        t.td().text(data.label1)
>        t.td().text(data.label2)

Your table is borken. It will render like this

<table class="excerciseTableClass">
	<tr class="tableHeadingClass" />
	<td>whatever label 1 was</td>
	<td>whatever label 2 was</td>
</table>

Notice you're not actually putting the td nodes inside the row. You 
want your code to save the return value from the call to tr (the tr 
node) and put the tds inside that:

t = d.table(_class="exerciseTableClass")
tr = t.tr(_class="tableHeadingClass")

tr.td().text(data.label1)
tr.td().text(data.label2)

dp





More information about the Twisted-Python mailing list