HTML

HTML Table Example

Posted on Updated on

Table Examples
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body>
<table align=”center” border=”1″  style=”width: 80%”>
<tr>
<td align=”center” style=”width:250px” >
</td>
<td style=”width:250px”>
Namee</td>
<td style=”width:250px”>
<input id=”Text1″ type=”text” /></td>
</tr>
<tr>

<td style=”width:250px”>
Address</td>
<td style=”width:250px”>
<input id=”Text2″ type=”text” /></td>
<td>
</td>
</tr>
<tr>

<td style=”width:250px”>
</td>
<td align=”center” style=”width:250px”>
<input id=”Button2″ type=”button” value=”Save” /></td>
<td>
</td>
</tr>
</table>
</body>
</html>

Table Row Vertical Align
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body bgcolor=”#ccffff”>
<table border=”1″ style=”height:200px”>
<tr valign=”middle”>
<th>Month</th>
<th>Savings</th>
</tr>
<tr valign=”bottom”>
<td>January</td>
<td>$100</td>
</tr>
</table>
</body>
</html>

Table Cell Align – Center

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body bgcolor=”#ccffff”>
<table border=”1″ style=”width: 100%;”>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>

<tr>
<td style=”height:107px”>

</td>
<td align=”center” valign=”top” style=”height:107px”>
<input id=”Submit1″ type=”submit” value=”submit” />
</td>
<td style=”height:107px”>
</td>
</tr>
<tr>
<td> &nbsp;</td>
<td> &nbsp;</td>
<td> &nbsp;</td>
</tr>
</table>
</body>
</html>

Table Background Image

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body bgcolor=”#ccffff”>
<table background=”http://www.tizag.com/pics/htmlT/background.jpg&#8221;
style=”width: 80%; height: 192px;”>
<tr>
<td>   </td>
<td>   </td>
<td>   </td>
</tr>
<tr>
<td>    </td>
<td>    </td>
<td>    </td>
</tr>
<tr>
<td>
</td>
<td align=”center”>
</td>
<td>
</td>
</tr>
</table>
</body>
</html>

Column Spanning in multiple Cells in Table

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body>

<table border=”1″ style=”width:75%;”>
<tr>
<td>               </td>
<td style=”width:250px”>
<input id=”Text2″ type=”text” /></td>
<td>
</td>
</tr>
<tr>
<td>                </td>
<td style=”width:250px”>
<input id=”Text1″ type=”text” /></td>
<td>
</td>
</tr>
<tr>
<td>                </td>
<td align=”center” colspan=”2″>
<input id=”Submit1″ type=”submit” value=”submit” /></td>
</tr>
</table>

</body>
</html>

HTML Example Body Color of a web page

Posted on

Body Color of a web page
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body bgcolor=”silver” style=”font-family:arial;color:red;font-size:20px;” text=”Red”>
<p>
This is to test the properties of body
</p>
</body>
</html>