How to Edit HTML Tables
- 1). Open your .html or .htm file. You can use any HTML editor to do this.
- 2). Locate the table you want to edit. A simple way to do this in a large file is to find the search function of your program and search for some text that is in the table you want to edit. The table code will start with a <table> tag.
- 3). Add more cells to the table. Cells are the boxes that information sits in.
The <tr> tag indicates that a new row is starting. A <td> tag creates a cell for text or images. To create a new row of two cells, you simply need to repeat the rows and cells. So your edited table would look something like this:
<table>
<tr>
<td>Data goes here</td>
<td>More data goes here</td>
</tr>
<tr>
<td>A new cell goes here</td>
<td>Another new cell goes here</td>
</tr>
</table> - 4). Change the width. You can add a "width=100px" attribute to the table tag to do this:
<table>
You can replace the "100px" with any width you'd like. - 5). Add a border to the table. To do this add a "border=1px" attribute to your table tag. It will look like this:
<table border="1px">
You can replace the "1px" with any size border you'd like. - 6). Add headers above each column. To do this replace your first <td> tags with <th> tags and put your header between the opening and closing tags. This will put a bold header above each column.
<table>
<tr>
<th>Colors</th>
<th>Numbers</th>
</tr>
<tr>
<td>Blue</td>
<td>One</td>
</tr>
</table> - 7). Save your file when you've finished editing it. Check it in your web browser.
Source...