Freeze Table Header …
<style
type="text/css">
overflow-y: auto;
height: 400px; /*
Adjust this value based on your requirement */
width:800px;
}
th {
position: sticky;
top: 0;
background-color: yellowgreen; /* Prevents header from
becoming transparent */
z-index: 100; /* Ensures the header stays on top of other
content */
}
<div class='table-container'>
<table border ='1' cellpadding='5'
style='width:100%; font-family:Arial;font-size:12px'>
<tr>
<th> Processed</th><th>Not
Processed</th><th>Exam</th>
</tr>
Print an HTML Page…
<style type="text/css">
/* This will hide the page header and footer */
@page
{
size: auto;
margin: 0;
}
/* This will hide the Button
cmdPrint */
@media print {
#cmdPrint {
display: none;
}
}
</style>
<html xmlns="http://www.w3.org/1999/xhtml"
>
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="cmdPrint"
runat="server"
Height="43px"
Text="Button" Width="137px" OnClientClick="javascript:window.print();return
false;" />
</div>
</form>
</body>
</html>
Center a DIV..
.center-div
{
margin: 0 auto;
width: 100px;
}
<div style="padding-left:50px; border: 5px solid gray; width:1345px " class="center-div">
CSS…
<HEAD>
<title>MyTemplate</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<link href="Styles.css" type="text/css" rel="stylesheet">
</HEAD>
<asp:textbox id=txtLev2
runat="server" cssClass="txtLev"></asp:textbox></TD>
In
the Styles.css…
.txtYears
{
Width:
50px;
Height:
20px;
}
Download a file…
Protected Sub Button1_Click(ByVal
sender As Object,
ByVal e As System.EventArgs)
Handles Button1.Click
Dim
strOutput As String
= "Hello World!"
Response.Clear()
Response.Buffer = True
Response.AppendHeader("Content-Disposition", "attachment; filename=TestFile" &
Now().ToShortDateString & ".xls")
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState
= False
Response.Write(strOutput)
Response.End()
End Sub
How to scroll any object…
<div style="OVERFLOW-Y:scroll; WIDTH:585px; HEIGHT:335px">
Place a table, datagrid or anything else you can think of here
</div>
Column Span Sample
<table width="75%" border="1">
<tr>
<td colspan="3">This Column comprises all 3 columns of the table!</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>