📄 tag_tr.asp
字号:
<table style="border: 1px solid gray" width="100%" bgcolor="#FFFFFF" border="0" cellpadding="5" cellspacing="0">
<tr>
<td>
<h1>HTML <tr> tag</h1>
<hr />
<h2>Definition and Usage</h2>
<p>Defines a row in a table.</p>
<hr />
<h2>Differences Between HTML and XHTML</h2>
<p>The "bgcolor" attribute of the tr element were <a href="javascript:NewWindow('deprecated.htm')">deprecated</a> in HTML 4.01.</p>
<p>The "bgcolor" attribute of the tr element are not supported in XHTML 1.0 Strict DTD.</p>
<hr />
<h2>Example</h2>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
<tr>
<th align="left" width="40%">Source</th>
<th align="left" width="60%">Output</th>
</tr>
<tr>
<td valign="top"><table border = "1"><br />
<tr><br />
<td>Cell A</td><br />
<td>Cell B</td><br />
</tr><br />
</table></td>
<td valign="top">
<table border="1">
<tr>
<td valign="top">Cell A</td>
<td valign="top">Cell B</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<hr />
<h2>Optional Attributes</h2>
<p><b>DTD</b> indicates in which <a href="tag_doctype.asp">DTD</a> the attribute is
allowed. S=Strict, T=Transitional, and F=Frameset.</p>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
<tr>
<th align="left" width="20%">Attribute</th>
<th align="left" width="20%">Value</th>
<th align="left" width="55%">Description</th>
<th align="left" width="5%">DTD</th>
</tr>
<tr>
<td valign="top">align</td>
<td valign="top">right<br />
left<br />
center<br />
justify<br />
char</td>
<td valign="top">Defines the text alignment in cells</td>
<td valign="top">STF</td>
</tr>
<tr>
<td valign="top">bgcolor</td>
<td valign="top">rgb(x,x,x)<br />
#xxxxxx<br />
colorname</td>
<td valign="top">Specifies the background color of the
table cell. Deprecated. Use styles instead.</td>
<td valign="top">TF</td>
</tr>
<tr>
<td valign="top">char</td>
<td valign="top">character</td>
<td valign="top">Specifies which character to align text on.<p><b>Note:</b>
Only used if align="char"!</td>
<td valign="top">STF</td>
</tr>
<tr>
<td valign="top">charoff</td>
<td valign="top">pixels<br />
%</td>
<td valign="top">Specifies the alignment offset to the first character to
align on.<p><b>Note:</b> Only used if align="char"!</td>
<td valign="top">STF</td>
</tr>
<tr>
<td valign="top">valign</td>
<td valign="top">top<br />
middle<br />
bottom<br />
baseline</td>
<td valign="top">Specifies the vertical text alignment in cells</td>
<td valign="top">STF</td>
</tr>
</table>
<h2>Standard Attributes</h2>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
<tr>
<td valign="top">id, class, title, style, dir, lang, xml:lang</td>
</tr>
</table>
<p>For a full description, go to <a href="ref_standardattributes.asp">Standard
Attributes</a>.</p>
<h2>Event Attributes</h2>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
<tr>
<td valign="top">onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup</td>
</tr>
</table>
<p>For a full description, go to <a href="ref_eventattributes.asp">Event Attributes</a>.</p>
<hr />
<h2>Try-It-Yourself Demos</h2>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table">Tables</a><br />
How to create tables in an HTML document.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_border">Table borders</a><br />
Different table borders.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_noborder">Table with no borders</a><br />
A table with no borders.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_header">Headings in a table</a><br />
How to display table headers.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_nbsp">Empty cells</a><br />
How to use "&nbsp;" to handle cells that have no content.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_caption">Table with a caption</a><br />
A table with a caption.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_span">Table cells that span more than one row/column</a><br />
How to define table cells that span more than one row or one column.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_elements">Tags inside a
table</a><br />
How to display elements inside other elements.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_cellpadding">Cell padding</a><br />
How to use cellpadding to create more white space between the cell content and
its borders.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_cellspacing">Cell spacing</a><br />
How to use cellspacing to increase the distance between the cells.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_background">Add a background color or a background image to a table</a><br />
How to add a background to a table.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_cellbackground">Add a background color or a background image to a table cell</a><br />
How to add a background to one or more table cells.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_align">Align the content in a table cell</a><br />
How to use the "align" attribute to align the content of cells.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_frame">The frame attribute</a><br />
How to use the "frame" attribute to control the borders around the table.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_table_frame2">The frame and border attributes</a><br />
How to use the "frame" and "border" attributes to control the borders around the table.</p>
<hr />
<!-- **** SPOTLIGHTS 1 **** -->
<iframe src="../banners/aspallframe.asp" height="110" width="485"
marginwidth="0" marginheight="0" frameborder="0" scrolling="no">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>
<hr />
<!-- **** SPOTLIGHTS 2 **** -->
<h2><a target="_blank" href="../../www.altova.com/ref/@s=w3s_spotlight&q=xmlspy">
Altova
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -