Python Forum

Full Version: modify the html table to include data from tkinter labels
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have the following html tags inside the mail function in python and I need to fill the table with data from labels insides python GUI tkinter.

msg.add_alternative("""\


  <!DOCTYPE html>
<html>

<head>
	<style>
		table,
		th,
		td {
			border: 1px solid black;
		}
	</style>
</head>

<body>

	<h2>Table With Border</h2>

	<p>Use the CSS border property to add a border to the table.</p>

	<table style="width:100%">
		<tr>
			<th>Firstname</th>
			<th>Lastname</th>
			<th>Age</th>
		</tr>
		<tr>
			<td>Jill</td>
			<td>Smith</td>
			<td>50</td>
		</tr>
		<tr>
			<td>Eve</td>
			<td>Jackson</td>
			<td>94</td>
		</tr>
		<tr>
			<td>John</td>
			<td>Doe</td>
			<td>80</td>
		</tr>
	</table>

</body>

</html>

  """,subtype='html')
instead of the manual data entry i have some data i collected from labels that i need to add to the table.