
Hi, Im using compose to convert data from my power apps to power platform. But the table seem distorted. I have attached the sample of the PDF that were generate.
Kindly advise me what should I do.
<html>
<head>
<title>Employee Data</title>
<style>
body {
font-family: Arial, sans-serif;
}
table {
width: 100%;
border-collapse: collapse;
background-color: #EEEEEE;
margin-bottom: 20px;
}
table, th, td {
border: 1px solid #1C6EA4;
}
table thead {
background-color: #1C6EA4;
color: #FFFFFF;
}
table thead th {
padding: 10px;
font-size: 15px;
border-left: 2px solid #D0E4F5;
}
table thead th:first-child {
border-left: none;
}
table tbody td {
padding: 8px;
font-size: 13px;
border: 1px solid #AAAAAA;
}
</style>
</head>
<body>
<h2>Employee Data</h2>
<table>
<thead>
<tr>
<th>ID</th>
<th>Employee ID</th>
<th>Department</th>
<th>Project</th>
<th>Site</th>
<th>Grade</th>
<th>Hours</th>
<th>Reasons</th>
<th>Status</th>
<th>Manager</th>
<th>Admin</th>
</tr>
</thead>
<tbody>
<!-- Repeat this <tr> block for each employee's data -->
<tr>
<td>@{items('Apply_to_each')?['ID']}</td>
<td>@{items('Apply_to_each')?['EmployeeID']}</td>
<td>@{items('Apply_to_each')?['Department']}</td>
<td>@{items('Apply_to_each')?['Project']}</td>
<td>@{items('Apply_to_each')?['Site']}</td>
<td>@{items('Apply_to_each')?['Grade/Value']}</td>
<td>@{items('Apply_to_each')?['Hours']}</td>
<td>@{items('Apply_to_each')?['Reasons']}</td>
<td>@{items('Apply_to_each')?['Status/Value']}</td>
<td>@{items('Apply_to_each')?['Manager/DisplayName']}</td>
<td>@{items('Apply_to_each')?['Admin/DisplayName']}</td>
</tr>
</tbody>
</table>
</body>
</html>
Hi @MuhamadLai99 ,
What is the issue that you are facing ?
I ran your code and created a PDF by passing some dummy values and it seems to be working fine.
Can you post the error that your getting or the PDF if that is breaking for you ? You can also try re-writing the HTML with by using inline styling. (You can use chat-gpt for it)
PDF Generated from the above code,
If this helps , do give this a thumbs up and mark this as a solution.
Thanks,
Sanmesh