Exampler.org SAS PYTHON HTML
HTML Home
HTML Table
HTML Form
HTML Button
HTML Checkbox
HTML Select
HTML Contact Form

HTML Tables;

What is it?

Syntax:

  • Table Tag: <Table> and </Table>
  • Header Tag : <TH> and </TH>
  • Row Tag: <TR> and </TR>
  • Data Tag: <TD> and </TD>


 Basic Table Example :




<Table border='1'>
     <TH>
          Languages
     </TH>
     <TH>
          Difficulty
     </TH>
     <TR>
          <TD> HTML </TD>
          <TD> Easy </TD>
     </TR>
     <TR>
          <TD> JavaScript </TD>
          <TD> Intermediate </TD>
     </TR>
     <TR>
          <TD> CSS </TD>
          <TD style='background: grey; color: white;' > Intermediate </TD>
     </TR>
</Table>





What's happening in the script above?

  • The above will build a table that has 2 Headers Rows entitled "Languages" and "Difficulty"
  • The <TR> indicates the starting of a new row, for which in this case we will want two <TD> tags to indicate 2 data elements.
  • Since there are now a couple of rows of data, we will need an additional <TR> tag to begin the 2nd row of data.
  • Next we end the table script by adding a closing </Table> tag.
  • < Table border='1' > indicates that our table will have a border around it. Oddly this is still HTML vs CSS in the bottom cell.
  • If you wanted to change the colors or anything else about it, we can use CSS to style it.


Example Output:

Languages Difficulty
HTML Easy
JavaScript Intermediate
CSS Intermediate



See also; HTML Form

See also; HTML Buttons

See also; HTML Iframe




Connect via LinkedIn

Kevin Regan

Have an article, idea, found a typo, want to contribute? Shoot me an email Here