📄 grid_int_from_html.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>DHTML Grid samples. dhtmlXGrid - Putting Complex content into header</title>
<meta name="KEYWORDS" content="dhtmlxgrid, dhtml grid, javascript grid, javascript, DHTML, grid, grid control, dynamical scrolling, xml, AJAX, API, cross-browser, checkbox, XHTML, compatible, gridview, navigation, script, javascript navigation, web-site, dynamic, javascript grid, dhtml grid, dynamic grid, item, row, cell, asp, .net, jsp, cold fusion, custom tag, loading, widget, checkbox, drag, drop, drag and drop, component, html, scand">
<meta name="DESCRIPTION" content="Cross-browser DHTML grid with XML support and powerful API. This DHTML JavaScript grid can load its content dynamically from server using AJAX technology.">
</head>
<style>
body, . {font-size:12px;font-family:arial;}
h1 {cursor:hand;font-size:16px;margin-left:10px;line-height:10px}
xmp {color:green;font-size:12px;font-family:courier;background-color:#e6e6fa;padding:2px}
DIV.txt{
margin-top:10px;
font-size:12px;font-family:arial;
}
div.hdr{
background-color:lightgrey;
margin-bottom:10px;
padding-left:10px;
}
div.h3{
padding-left:10px;
padding-right:10px;
margin-bottom:10px;
margin-top:10px;
font-size:14px;
font-family: verdana;
color:white;
background-color:green;
width:300px;
white-space:nowrap;
display:table;
}
</style>
<body>
<div class="hdr">DHTML JavaScript Grid samples </div>
<h1>Initialize Grid from HTML table</h1>
<link rel="STYLESHEET" type="text/css" href="../css/dhtmlXGrid.css">
<script src="../js/dhtmlXCommon.js"></script>
<script src="../js/dhtmlXGrid.js"></script>
<script src="../js/dhtmlXGridCell.js"></script>
<script src="../js/dhtmlXGrid_start.js"></script>
<div class="h3">Initialize from HTML table with script command</div>
<div class="txt">
<li><a href="javascript:void(0)" onclick="new dhtmlXGridFromTable('tblToGrid');">Convert table to grid</a></li>
</div>
<table id="tblToGrid" style="width:400px" border="1">
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
<tr>
<td>value 11</td>
<td>value 12</td>
</tr>
<tr>
<td>value 21</td>
<td>value 22</td>
</tr>
<tr>
<td>value 31</td>
<td>value 32</td>
</tr>
<tr>
<td>value 41</td>
<td>value 42</td>
</tr>
<tr>
<td>value 51</td>
<td>value 52</td>
</tr>
</table>
<XMP>
var mygrid = new dhtmlXGridFromTable('tblToGrid');
</XMP>
<div class="h3">Automatic initialization</div>
<table class="dhtmlxGrid" style="width:400px">
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
<tr>
<td>value 11</td>
<td>value 12</td>
</tr>
<tr>
<td>value 21</td>
<td>value 22</td>
</tr>
<tr>
<td>value 31</td>
<td>value 32</td>
</tr>
<tr>
<td>value 41</td>
<td>value 42</td>
</tr>
<tr>
<td>value 51</td>
<td>value 52</td>
</tr>
</table>
<div class="txt">
<li>Initialize automatically from table which class attribute set to "dhtmlxGrid"</li>
</div>
<XMP>
//required js file
<script src="js/dhtmlXGrid_start.js"></script>
<!--- table to convert --->
<table class="dhtmlxGrid" style="width:400px">
<!--- First row treatted as grid header --->
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
<!--- All other rows - Grid body --->
<tr>
<td>value 11</td>
<td>value 12</td>
</tr>
<tr>
<td>value 21</td>
<td>value 22</td>
</tr>
...
</table>
</XMP>
<hr>
<p><a href="http://www.scbr.com/docs/products/dhtmlxGrid/index.shtml" style="font-weight:bold;">Go to the dhtmlxGrid main page</a> or <a href="javascript:self.close()">Close this page</a></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -