Search DaTutorials:  
HOME
Html Tutorials
Basics
Forms
Frames
Hyperlinks and URLS
Images
Lists
Background
Colors
Fonts
Tables
Meta Tags
Events
Javascript Integration
Sound
Other
Search For a Tutorial
Html Reference

First table

Description:


How to create your first table.

Code:

<html>
<body>


<h4>One column table:</h4>
<table border="1">
<tr>
  <td>cell 1</td>
</tr>
</table>


<h4>One row and two columns table:</h4>
<table border="1">
<tr>
  <td>cell 1</td>
  <td>cell 2</td>
</tr>
</table>


<h4>Two rows and two columns table:</h4>
<table border="1">
<tr>
  <td>cell 1</td>
  <td>cell 2</td>
</tr>


<tr>
  <td>cell 3</td>
  <td>cell 4</td>
</tr>
</table>


<h4>Three rows and two columns table:</h4>
<table border="1">
<tr>
  <td>cell 1</td>
  <td>cell 2</td>
</tr>
<tr>
  <td>cell 3</td>
  <td>cell 4</td>
</tr>
<tr>
  <td>cell 5</td>
  <td>cell 6</td>
</tr>
</table>

</body>
</html>

Play with the code:

See working example:


Explanation:

To create a table in an html page use the <table></table> tag. To insert a new row in the table use the <tr></tr> tag within the table tag. To insert cell in the row, use the <td></td> tag within the row tag.

The border atribute of the table tag defines the width of the table's border.

See Also:

HTML: Html, Body, Table, Tr, Td


Online Html Forum  Discuss this tutorial in our HTML forum


     Credit Cards UK | Loans | Homeowner Loan | Free Engineering Ebooks | iPhone Reviews
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp