Created
August 6, 2022 03:44
-
-
Save dele454/64f2d7668c11c7549eab4525a7f8945c to your computer and use it in GitHub Desktop.
Part 1 - CSV Transformation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>{{.FileName}}</title> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"> | |
</head> | |
<body class=""> | |
<div class="container-fluid"> | |
<h1>{{.FileName}}</h1> | |
<table class="table table-striped"> | |
<tr colspan="{{.TotalHeaders}}" class="success"> | |
{{range $header := .Headers}} | |
<th>{{$header}}</th> | |
{{end}} | |
</tr> | |
{{ $total := .TotalHeaders }} | |
{{ range $d := .Data}} | |
<tr colspan="{{$total}}"> | |
<td>{{.Region}}</td> | |
<td>{{.Country}}</td> | |
<td>{{.ItemType}}</td> | |
<td>{{.SalesChannel}}</td> | |
<td>{{.OrderPriority}}</td> | |
<td>{{.OrderDate}}</td> | |
<td>{{.OrderID}}</td> | |
<td>{{.ShipDate}}</td> | |
<td>{{.UnitsSold}}</td> | |
<td>{{.UnitPrice}}</td> | |
<td>{{.UnitCost}}</td> | |
<td>{{.TotalRevenue}}</td> | |
<td>{{.TotalCost}}</td> | |
<td>{{.TotalProfit}}</td> | |
</tr> | |
{{else}} | |
<tr> | |
<td colspan="{{$total}}" align="center">No data was exported.</td> | |
</tr> | |
{{end}} | |
</table> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment