Computer >> Computer tutorials >  >> Programming >> HTML

How to use an HTML tag inside HTML table?


With HTML, you can easily add HTML tag inside a table. The tag should open and close inside the <td> tag. For example, adding a paragraph <p>…</> tag or even a list tag i.e. <ul>…<ul>.

How to use an HTML tag inside HTML table?

Example

You can try to run the following code to use an HTML tag <ul>…</ul> inside HTML table

<!DOCTYPE html>
<html>
   <head>
      <style>
         table, th, td { border: 1px solid black; width: 400px; }
      </style>
   </head>
   <body>
      <h1> Total Points</h1>
      <table>
         <tr>
            <th>Technologies</th>
            <th>Points</th>
         </tr>
         <tr>
            <td>Programming Languages
               <ul>
                  <li>C++</li>
                  <li>Java</li>
                  <li>C</li>
               </ul>
            </td>
            <td>100</td>
         </tr>
         <tr>
            <td>Database
               <ul>
                  <li>MySQL</li>
                 <li>Oracle</li>
                 <li>CouchDB</li>
              </ul>
           </td>
           <td>50</td>
        </tr>
     </table>
   </body>
</html>