Hello friends
I just started learning HTML going good now i want to create table in HTML can anyone tell me how to create table in HTML ? I have basic knowledge of HTML.
Printable View
Hello friends
I just started learning HTML going good now i want to create table in HTML can anyone tell me how to create table in HTML ? I have basic knowledge of HTML.
Tables are defined with the <table> tag. A table is divided into rows (with the <tr> tag), and each row is divided into data cells (with the <td> tag). The letters td stands for "table data," which is the content of a data cell. A data cell can contain text, images, lists, paragraphs, forms, horizontal rules, tables, etc.
TR defines a Table Row - a table is made up of any number of any number of rows, depending on how you design it. Each row in turn contains cells,
TD - TD elements are used for data
TH - TH elements are used for row or column headings
The <table> tag defines an HTML table.
A simple HTML table consists of the table element and one or more tr, th, and td elements.
Code:<html>
<table border="1"><tr><TH>Heading 1 <TH> Heading 2 </TH></tr>
<tr>
<td>1</td>
<td> A</td>
</tr>
<tr>
<td>2</td>
<td>B</td>
</tr>
</table>
</html>
The color of the table borders as a whole is set with the BORDERCOLOR attribute of the <TABLE ...> tag. For example, this code sets the border to red:
<TABLE BORDER=2 BORDERCOLOR= BLUE>
<TR> <TD>carrots</TD> <TD>garlic</TD> </TR>
<TR> <TD>celery</TD> <TD>onions</TD> </TR>
</TABLE>