HTML Table

What is a table?

The table contains rows and columns to represent data.

How to put a table in HTML?

Download Code

table in html

Output:

table in hypertext markup language

Explanation:

Statement 4: <tr> is for table row

Statement 5: <td> is for table column

First Row:

Statement 4: Starting of first row

Statement 6: Ending of first row

Second Row:

Statement 8: Starting of second row

Statement 11: Ending of second  row

<table border="3" bordercolor="#FFCC00">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>
apple
</td>
<td>
banana
</td>
</tr>
</table>

Output

1 2 3
apple banana

Video Lecture

Exercise of HTML Tables

Write the HTML code for the following interface.

A1 B1 C1 D1
9-10-am 10-aa am 11-12-am 1-2 pm 2-3pm 3-34pm 4-5pm 5-6pm 6-7pm 7-8pm 8-9 pm
E1 Monday D A B C
Tuesday E F
G1 wednesday T4TUTORIALS 001 PREPARATION
thursday T4TUTORIALS 002 I G
H1 friday research H
<table width="400" border="3" cellspacing="4" cellpadding="5">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="3">A1</td>
    <td>B1</td>
    <td colspan="4">C1</td>
    <td colspan="3">D1</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>9-10-am</td>
    <td><p>10-aa am</p>    </td>
    <td>11-12-am</td>
    <td>1-2 pm </td>
    <td>2-3pm</td>
    <td>3-34pm</td>
    <td>4-5pm</td>
    <td>5-6pm</td>
    <td>6-7pm</td>
    <td>7-8pm</td>
    <td>8-9 pm</td>
  </tr>
  <tr>
    <td rowspan="2">E1</td>
    <td>Monday</td>
    <td colspan="3">D</td>
    <td>&nbsp;</td>
    <td colspan="3">A</td>
    <td>B</td>
    <td colspan="3">C</td>
    
    
  </tr>
  <tr>
    <td>Tuesday</td>
    <td colspan="3">E</td>
    <td>&nbsp;</td>
    <td colspan="7">F</td>
    
    
  </tr>
  <tr>
    <td rowspan="2">G1</td>
    <td>wednesday</td>
    <td colspan="3">T4TUTORIALS 001 </td>
    <td>&nbsp;</td>
    <td colspan="7">PREPARATION</td>
    
  </tr>
  <tr>
    <td>thursday</td>
    <td colspan="3">T4TUTORIALS 002 </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="3">I</td>
    <td colspan="3">G</td>
  
   
  </tr>
  <tr>
    <td>H1</td>
    <td>friday</td>
    <td colspan="3">research</td>
    <td >&nbsp;</td>
    <td colspan="7">H</td>
    
  </tr>
</table>

 

 

Prof.Fazal Rehman Shamil (Available for Professional Discussions)
1. Message on Facebook page for discussions,
2. Video lectures on Youtube
3. Email is only for Advertisement/business enquiries.