📄 tr.html
字号:
<html>
<head>
<title>tr - HTML元素参考-HTML Elements Reference-网页教程与代码的中文站点-布啦布啦-blabla.cn</title>
<meta name="author" content="www.blabla.cn">
<meta name="keywords" content="tr,HTML参考手册,HTML教程, HTML代码,HTML元素,HTML elements,网页教程和代码的中文网站,网页制作,源代码,示例,布啦布拉,blabla.cn,examples">
<meta name="description" content="-网页教程与代码的中文站点-网页制作-布啦布啦-blabla.cn">
<meta name="generator" content="blabla buildsite v2.0 - C:\CodeBank\BLABLA\blablasource\webtutorials\150_html_ref\100_html_elements\495_tr.txt">
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../styles/bla01.css" type="text/css">
<script type="text/javascript">
function WsFvt() {
window.external.addFavorite(
"../default.htm",
"布啦布啦网页教程与代码[www.blabla.cn]");
}
function WsHome() {
event.srcElement.style.behavior = "url(#default#homepage)";
event.srcElement.setHomePage("../default.htm");
}
function WsActOn() {
event.srcElement.className = "wsacton";
}
function WsAct() {
event.srcElement.className = "wsact";
}
</script>
</head>
<body class=wsbody>
<div class=wsheader>
<table cellpadding=0 cellspacing=0 class=wslogoarea>
<td class=ws_a1><img src="../images/logo/blabla_logo01.gif" class=blablalogo03></td>
<td class=ws_a2>
<div>
<font class=wsact onmouseover="WsActOn()" onmouseout="WsAct()" onclick="WsFvt()">加入收藏</font> |
<font class=wsact onmouseover="WsActOn()" onmouseout="WsAct()" onclick="WsHome()">设为首页</font>|
<a href="mailto:webmaster@blabla.cn">联系我们</a>
</div>
<div style = "height:20px;"></div>
<div>
<a href="../html_tutorials/index.html">HTML教程</a> |
<a href="../html_tutorials/100_html_examples.html">HTML示例代码</a> |
<a href="../css_tutorials/index.html">CSS教程</a> |
<a href="../css_tutorials/100_CSS_examples.html">CSS示例代码</a> |
<a href="../js_tutorials/index.html">Javascript教程</a> |
<a href="../js_tutorials/100_js_examples.html">Javascript示例代码</a>
</div>
</td>
</tr></table>
</div>
<div class=wscontent>
<table cellpadding=0 cellspacing=0 class=wscgrid>
<td class=a1>
<div class=wsmenu><div class=box><div class=box>
<!--menupart Start -->
<a href = "../index.html"><H1>网站首页</H1></a>
<a href = "index.html" ><H1>HTML元素参考</H1></a><a href = "../html_attr_ref/index.html" ><H1>HTML属性参考</H1></a>
<!--menupart end -->
</div></div></div>
</td>
<td class=a2><div class=wsarticle><div class=articlepart id = ap>
<div class=wstitle><div class=box><div class=box><h1>HTML元素 - tr</h1></div></div></div>
<!--articlepart start-->
<div class = changefont>
<span onclick= "ap.className='ArticlePartBig';" class = bfont>大字体</span>
<span onclick= "ap.className='ArticlePart';" class = sfont>小字体</span>
</div>
<H2>定义</H2><P>指定表格中的一行。</P><P>Specifies a row in a table.</P><H2>注释</H2><P>TD 和 TH 元素可以在行中出现。</P><P>要更改 TR 元素中的 HTML,请使用表格对象模型。例如,使用 rowIndex 属性或 rows 集合获取对特定表格行的引用。你可以使用 insertRow 和 deleteRow 方法添加或删除行。要获取对特定单元格的引用,请使用 cellIndex 属性或 cells 集合。你可以使用 insertCell 和 deleteCell 方法添加或删除单元格。要更改特定单元格的内容,请使用 innerHTML 或 innerText 属性。</P><P>table 对象及其相关的元素有各自独立的表格对象模型,这与常规对象模型所采用的方法有很大不同。要获得关于表格对象模型更多的信息,请参看如何动态生成表格。</P><P>此元素在 Internet Explorer 3.0 及以上版本的 HTML 中可用,在 Internet Explorer 4.0 及以上版本的脚本中可用。</P><P>此元素是块元素。</P><P>此元素需要关闭标签。</P><P>The TD and TH elements are valid within a row.</P><P>To change the HTML in the TR element, use the table object model. For example, use the rowIndex property or the rows collection to retrieve a reference to a specific table row. You can add or delete rows using the insertRow and deleteRow methods. To retrieve a reference to a specific cell, use the cellIndex property or the cells collection. You can add or delete cells using the insertCell and deleteCell methods. To change the content of a particular cell, use the innerHTML or innerText property.</P><P>The table object and its associated elements have a separate table object model, which utilizes different methods than the general object model. For more information on the table object model, see How to Build Tables Dynamically.</P><P>This element is available in HTML as of Internet Explorer 3.0 and in script as of Internet Explorer 4.0.</P><P>This element is a block element.</P><P>This element requires a closing tag.</P><H2>示例代码</H2><P>这个例子使用了 TR 元素和 TABLE, TD 及 TR 元素创建了两行的表格。</P><PRE><TABLE></PRE><PRE><TR></PRE><PRE><TD>This is the first row.</TD></PRE><PRE></TR></PRE><PRE><TR></PRE><PRE><TD>This is the second row.</TD></PRE><PRE></TR></PRE><PRE></TABLE></PRE><P>这个例子使用表格对象模型在用户单击按钮时向表格中动态添加了两行和两个单元格。</P><PRE><SCRIPT></PRE><PRE>function createRows(){</PRE><PRE> // Insert two rows.</PRE><PRE> var oRow1=oTable.insertRow(oTable.rows.length);</PRE><PRE> var oRow2=oTable.insertRow(oTable.rows.length);</PRE><PRE> </PRE><PRE> // Retrieve the rows collection for the table.</PRE><PRE> var aRows=oTable.rows;</PRE><PRE> </PRE><PRE> // Retrieve the cells collection for the first row.</PRE><PRE> var aCells=oRow1.cells;</PRE><PRE> </PRE><PRE> // Insert two cells into the first row.</PRE><PRE> var oCell1_1=aRows(oRow1.rowIndex).insertCell(aCells.length);</PRE><PRE> var oCell1_2=aRows(oRow1.rowIndex).insertCell(aCells.length);</PRE><PRE> </PRE><PRE> // Retrieve the cells collection for the second row.</PRE><PRE> aCells=oRow2.cells;</PRE><PRE> </PRE><PRE> // Insert two cells into the second row.</PRE><PRE> var oCell2_1=aRows(oRow2.rowIndex).insertCell(aCells.length);</PRE><PRE> var oCell2_2=aRows(oRow2.rowIndex).insertCell(aCells.length);</PRE><PRE> </PRE><PRE> // Add regular HTML values to the 4 new cells. </PRE><PRE> oCell1_1.innerHTML="<B>Cell 1.1!</B>";</PRE><PRE> oCell1_2.innerHTML="<B>Cell 1.2!</B>";</PRE><PRE> oCell2_1.innerHTML="<B>Cell 2.1!</B>";</PRE><PRE> oCell2_2.innerHTML="<B>Cell 2.2!</B>"; </PRE><PRE>}</PRE><PRE></SCRIPT></PRE><PRE><INPUT TYPE="button" VALUE="Create Rows" onclick="createRows()"></PRE><PRE><TABLE BORDER=1 ID="oTable"></PRE><PRE></TABLE></PRE><H2>另见</H2><P><a href = "table.html">table</a></P><H2> </H2><P> </P><P> </P><P> </P>
<!--articlepart end-->
</div><div></td>
<td class=a3><div class=wslink>
<div class=wsportrait>
<img src="../images/logo/blabla_logo02.gif" class=blablalogo21>
</div>
<div class=wslgreen><div class=box><div class=box>
<h2>布啦布啦旗下网站</h2>
<p><a href="../index.html">布啦布啦网页教程与代码</a></p>
<p><a href="http://www.wowstory.com">小斧的魔兽世界</a></p>
<p><a href="../wow/index.html">小斧的魔兽世界镜像</a></p>
<p><a href="http://hardware.blabla.cn">数码资讯</a></p>
</div></div></div>
<div style= "background-color:#FFFFF0;
border-top:3px solid #FFCC66; border-bottom:3px solid #FFCC66;border-left:1px solid #FFE0A1;border-right:1px solid #FFE0A1;">
<!-- SiteSearch Google -->
<form method="get" action="http://www.google.com/custom" target="_top">
<table border="0" bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">
</td>
<td nowrap="nowrap">
<input type="hidden" name="domains" value="blabla.cn"></input>
<input type="text" name="q" size="18" maxlength="255" value=""></input>
</td></tr>
<tr>
<td> </td>
<td nowrap="nowrap">
<table>
<tr>
<td>
<input type="radio" name="sitesearch" value=""></input>
<font size="-1" color="#000000" style = "font-size:12px;">Web</font>
</td>
<td>
<input type="radio" name="sitesearch" value="blabla.cn" checked="checked"></input>
<font size="-1" color="#000000" style = "font-size:12px;">blabla.cn</font>
</td>
</tr>
</table>
<input type="submit" name="sa" value="Google 搜索"></input>
<input type="hidden" name="client" value="pub-3105632846497229"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="GB2312"></input>
<input type="hidden" name="oe" value="GB2312"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>
<input type="hidden" name="hl" value="zh-CN"></input>
</td></tr></table>
</form>
<!-- SiteSearch Google -->
</div>
<div style ="height:8px;font-size:8px;"></div>
<!--Google Adsense start-->
<div id="googlead" style = "width:160px; height:600px;" ></div>
<!--Google Adsense end-->
</div>
</td></tr>
</table></div>
<div class=wsfooter>
<table cellpadding=0 cellspacing=0 class=wsgrid>
<tr><td class=ws_a1>
<!--footer label start-->
© 2005 blabla.cn版权所有
<!--51yes statistics start-->
<script language="javascript" src="http://count1.51yes.com/click.aspx?id=13420718&logo=12"></script>
<!--51yes statistics end-->
</td></tr></table>
</div>
<!--Google Ad Script Start -->
<div id="googleadcode" style="display:none;">
<script type="text/javascript"><!--
google_ad_client = "pub-3105632846497229";
google_alternate_color = "FFFFFF";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "A8C8FF";
google_color_bg = "F5F9FF";
google_color_link = "0058DB";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<script language="javascript">
if(document.all.item("googlead") != null)
{
googlead.innerHTML = googleadcode.innerHTML;
}
</script>
<!--Google Ad Script End-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -