How to Convert a List of Bullets to a Table in HTML
Tables and unordered lists are two methods that Web designers use to format data on a website. An unordered list compiles data into a list with bullet points, while a table uses rows of cells similar to a spreadsheet. The two formats are fairly similar, making it simple to convert an unordered list into a basic table. All you need to do is change the HTML tags for the list into the tags needed for a table.
Instructions
-
-
1
Open the HTML file in a text-editing program.
-
2
Navigate to the start of the unordered list. It will look something like this:
<ul>
<li> Item 1
<li> Item 2
<li> Item 3
</ul>
-
-
3
Replace the <ul> that begins the bulleted list with <table> to start a table. If desired, add <table border="1"> to create a table with a border. The number can be changed to any border width you want.
-
4
Replace each <li> with <tr><td> before the contents, and </td></tr> after. For example, "<li> Item 1" becomes "<tr><td> Item 1 </td></tr>"
-
5
Replace the </ul> at the end of the list with </table> to close the table. Following this procedure, the list in step 2 has become the following table:
<table>
<tr><td> Item 1 </td></tr>
<tr><td> Item 2 </td></tr>
<tr><td> Item 3 </td></tr>
</table>
-
1
References
- Photo Credit Jupiterimages/Brand X Pictures/Getty Images