Hi everyone i have a python script for Automatisation that work very good the only problem i have is how i recieve my csv to html table i want it to be well formatted please
<code>def send_email(file_path, html_content):
# Attach HTML content
body = f"""
<html>
<head>
<style>
table {{
font-family: Arial, sans-serif;
border-collapse: collapse;
width: 100%;
}}
th, td {{
border: 1px solid #ddd;
padding: 8px;
text-align: center;
}}
th {{
background-color: #f2f2f2;
font-weight: bold;
}}
</style>
</head>
<body>
<p>Please find the exported file attached.</p>
<p>CSV Data:</p>
{html_content}
</body>
</html>
"""
</code>
<code>def send_email(file_path, html_content):
# Attach HTML content
body = f"""
<html>
<head>
<style>
table {{
font-family: Arial, sans-serif;
border-collapse: collapse;
width: 100%;
}}
th, td {{
border: 1px solid #ddd;
padding: 8px;
text-align: center;
}}
th {{
background-color: #f2f2f2;
font-weight: bold;
}}
</style>
</head>
<body>
<p>Please find the exported file attached.</p>
<p>CSV Data:</p>
{html_content}
</body>
</html>
"""
</code>
def send_email(file_path, html_content):
# Attach HTML content
body = f"""
<html>
<head>
<style>
table {{
font-family: Arial, sans-serif;
border-collapse: collapse;
width: 100%;
}}
th, td {{
border: 1px solid #ddd;
padding: 8px;
text-align: center;
}}
th {{
background-color: #f2f2f2;
font-weight: bold;
}}
</style>
</head>
<body>
<p>Please find the exported file attached.</p>
<p>CSV Data:</p>
{html_content}
</body>
</html>
"""
1