Email body html table
Here is an example of an HTML table that can be used in an email body:
<table border="1" cellpadding="5" cellspacing="0" width="100%">
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
</tr>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
</tr>
<tr>
<td>Cell 4</td>
<td>Cell 5</td>
<td>Cell 6</td>
</tr>
</table>
This will create a simple table with three columns and three rows. You can customize the table by adding more rows, columns, and cells as needed.
Here are some additional tips for using HTML tables in email bodies:
- Use the
border
attribute to set the border width and style of the table. - Use the
cellpadding
andcellspacing
attributes to set the padding and spacing between cells. - Use the
width
attribute to set the width of the table. - Use the
th
element to define table headers, and thetd
element to define table cells. - Use the
tr
element to define table rows. - You can use CSS styles to customize the appearance of the table, such as setting the background color, font size, and font style.
Here is an example of a more complex HTML table that includes CSS styles:
<table border="1" cellpadding="5" cellspacing="0" width="100%">
<style>
table {
border-collapse: collapse;
width: 100%;
}
th, td {
border: 1px solid #ddd;
padding: 10px;
text-align: left;
}
th {
background-color: #f0f0f0;
}
</style>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
</tr>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
</tr>
<tr>
<td>Cell 4</td>
<td>Cell 5</td>
<td>Cell 6</td>
</tr>
</table>
This will create a table with a border, padding, and spacing between cells, and a background color for the table headers. You can customize the styles as needed to fit your email design.