Hi Prabhat, Thanks for fixing some of your code. I think you may still have some inline code in your paragraph at top that we can't see. Inline code can be wrapped with single backtick's Your second code block would be invalid html. elements can only appear inside a element. They can also be children of , , and but those elements would need to be children of the table element. So ultimately, a tr needs a table ancestor. I believe the only place a div would be allowed when working with table elements is inside of a td or th
Answer from Jason Anello on teamtreehouse.com
Discussions

How would you make a table row with an inner tr? - Help Requests - The Aurelia Discourse
How would you make a table row with an inner tr ยท However, I need to convert this to a table, because I need to be able to copy and paste the table ยท If I understand you correctly you want to do a repeat.for on the contractList but instead of a single row, have 2 rows More on discourse.aurelia.io
๐ŸŒ discourse.aurelia.io
1
April 9, 2020
Using <tr> and <td> inside <div>
Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today. Start your free trial ... At my work I came across this situation where I have to use html tags to format tooltips for java applet using StringBuffer. More on teamtreehouse.com
๐ŸŒ teamtreehouse.com
6
April 5, 2014
webforms - Create a HTML table where each TR is a FORM - Stack Overflow
I wouldn't try to play with both when there are simpler solutions, it's a recipe for having the worse of both worlds. And I'm not talking about a grid (the visual thing), there's (or should be) display: table-cell; for that but of the element table with its constraints in HTML. 2010-10-27T18:32:04.97Z+00:00 ... Find the answer to your question by asking. Ask question ... See similar questions with these tags... More on stackoverflow.com
๐ŸŒ stackoverflow.com
HTML Data Scraping from <td>'s within a <tr> tag

Can you specify what is wrong with the format? If you do not want any formatting I think it should be possible to loop through td elements of the tr and get only the values.

More on reddit.com
๐ŸŒ r/excel
45
6
October 2, 2012
People also ask

How do I use the tag in HTML?
To use the tag, you need to place it between the opening tag and the closing
tag. Inside the tag, you can include one or more or tags to represent individual cells within the row. This arrangement allows you to create a grid-like structure for displaying information.
๐ŸŒ
lenovo.com
lenovo.com โ€บ home
What is HTML TR Tag? | How do I use the tr tag in HTML? | Lenovo US
What is the hypertext markup language (HTML) tag?
The HTML tag, short for "table row," is used to define a row in an HTML table. It acts as a container for table data cells ( elements) and can also include table header cells ( elements). This tag organizes content in a structured manner, making it easier to present and manipulate tabular data on a webpage.
๐ŸŒ
lenovo.com
lenovo.com โ€บ home
What is HTML TR Tag? | How do I use the tr tag in HTML? | Lenovo US
How can I add attributes to the tag for additional functionality?
You can include various attributes within the tag to enhance its functionality. Common attributes include "class" for styling purposes, "id" for unique identification, and "onclick" for specifying JavaScript functions to execute when the row is clicked. These attributes provide flexibility and customization options, allowing you to tailor the behavior and appearance of your table rows based on specific requirements.
๐ŸŒ
lenovo.com
lenovo.com โ€บ home
What is HTML TR Tag? | How do I use the tr tag in HTML? | Lenovo US
๐ŸŒ
Web Reference
webreference.com โ€บ html โ€บ tags โ€บ tr
The <tr> HTML Element
html ยท /tags ยท /tr ยท The <tr> element is used to define a row of cells in an HTML table. These cells can be data cells (<td>), header cells (<th>), or a combination of both.
๐ŸŒ
Aurelia
discourse.aurelia.io โ€บ help requests
How would you make a table row with an inner tr? - Help Requests - The Aurelia Discourse
April 9, 2020 - How would you make a table row with an inner tr ยท However, I need to convert this to a table, because I need to be able to copy and paste the table ยท If I understand you correctly you want to do a repeat.for on the contractList but instead of a single row, have 2 rows
๐ŸŒ
Lenovo
lenovo.com โ€บ home
What is HTML TR Tag? | How do I use the tr tag in HTML? | Lenovo US
Please visit cart for more details. ... Please review your cart as items have changed. ... The HTML <tr> tag, short for "table row," is used to define a row in an HTML table. It acts as a container for table data cells (<td> elements) and can also include table header cells (<th> elements).
๐ŸŒ
Quora
quora.com โ€บ What-is-the-difference-between-tr-and-td-tags-in-HTML
What is the difference between tr and td tags in HTML? - Quora
Answer (1 of 2): The and tags are used in HTML to create tables. The tag defines a row in a table, while the tag defines a cell in a table. The tag is used inside a tag to create each cell in a row.
Find elsewhere
๐ŸŒ
Scaler
scaler.com โ€บ topics โ€บ tr-tag-in-html
<tr> Tag in HTML - Scaler Topics
June 30, 2022 - The <tr> tag in HTML is used to define a row in a table in HTML.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ html-tr-tag
HTML tr Tag - GeeksforGeeks
4 weeks ago - The <tr> tag in HTML defines a single row within a table, grouping related data or headers horizontally.
๐ŸŒ
TechOnTheNet
techonthenet.com โ€บ html โ€บ elements โ€บ tr_tag.php
HTML: <tr> tag
This HTML tutorial explains how to use the HTML element called the tr tag with syntax and examples. The HTML tr tag defines a row in an HTML table (also called tr element).
๐ŸŒ
W3Schools
w3schools.com โ€บ html โ€บ html_table_headers.asp
HTML Table Headers
HTML Tag List HTML Attributes HTML Global Attributes HTML Browser Support HTML Events HTML Colors HTML Canvas HTML Audio/Video HTML Doctypes HTML Character Sets HTML URL Encode HTML Lang Codes HTTP Messages HTTP Methods PX to EM Converter Keyboard Shortcuts ... HTML tables can have headers for each column or row, or for many columns/rows. Table headers are defined with th elements. Each th element represents a table cell. <table> <tr> <th>Firstname</th> <th>Lastname</th> <th>Age</th> </tr> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>94</td> </tr> </table> Try it Yourself ยป
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ what-is-the-tr-element-in-html
What is the <tr> element in HTML?
The <tr> tag stands for table row. It is used to create a row in a table in HTML.
Top answer
1 of 12
105

If you want a "editable grid" i.e. a table like structure that allows you to make any of the rows a form, use CSS that mimics the TABLE tag's layout: display:table, display:table-row, and display:table-cell.

There is no need to wrap your whole table in a form and no need to create a separate form and table for each apparent row of your table.

Try this instead:

<style>
DIV.table 
{
    display:table;
}
FORM.tr, DIV.tr
{
    display:table-row;
}
SPAN.td
{
    display:table-cell;
}
</style>
...
<div class="table">
    <form class="tr" method="post" action="blah.html">
        <span class="td"><input type="text"/></span>
        <span class="td"><input type="text"/></span>
    </form>
    <div class="tr">
        <span class="td">(cell data)</span>
        <span class="td">(cell data)</span>
    </div>
    ...
</div>

The problem with wrapping the whole TABLE in a FORM is that any and all form elements will be sent on submit (maybe that is desired but probably not). This method allows you to define a form for each "row" and send only that row of data on submit.

The problem with wrapping a FORM tag around a TR tag (or TR around a FORM) is that it's invalid HTML. The FORM will still allow submit as usual but at this point the DOM is broken. Note: Try getting the child elements of your FORM or TR with JavaScript, it can lead to unexpected results.

Note that IE7 doesn't support these CSS table styles and IE8 will need a doctype declaration to get it into "standards" mode: (try this one or something equivalent)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Any other browser that supports display:table, display:table-row and display:table-cell should display your css data table the same as it would if you were using the TABLE, TR and TD tags. Most of them do.

Note that you can also mimic THEAD, TBODY, TFOOT by wrapping your row groups in another DIV with display: table-header-group, table-row-group and table-footer-group respectively.

NOTE: The only thing you cannot do with this method is colspan.

Check out this illustration: http://jsfiddle.net/ZRQPP/

2 of 12
14

If all of these rows are related and you need to alter the tabular data ... why not just wrap the entire table in a form, and change GET to POST (unless you know that you're not going to be sending more than the max amount of data a GET request can send).

(That's assuming, of course, that all of the data is going to the same place.)

<form method="POST" action="your_action">
<table>
<tr>
<td><input type="text" name="r1c1" value="" /></td>
<!-- ... snip ... -->
</tr>
<!-- ... repeat as needed ... -->
</table>
</form>
๐ŸŒ
W3Schools
w3schools.com โ€บ html โ€บ html_tables.asp
HTML Tables
HTML Tag List HTML Attributes HTML Global Attributes HTML Browser Support HTML Events HTML Colors HTML Canvas HTML Audio/Video HTML Doctypes HTML Character Sets HTML URL Encode HTML Lang Codes HTTP Messages HTTP Methods PX to EM Converter Keyboard Shortcuts ... HTML tables allow web developers to arrange data into rows and columns. ... A table in HTML consists of table cells inside rows and columns. ... <table> <tr> <th>Company</th> <th>Contact</th> <th>Country</th> </tr> <tr> <td>Alfreds Futterkiste</td> <td>Maria Anders</td> <td>Germany</td> </tr> <tr> <td>Centro comercial Moctezuma</td> <td>Francisco Chang</td> <td>Mexico</td> </tr> </table> Try it Yourself ยป
๐ŸŒ
DotFactory
dofactory.com โ€บ html โ€บ tr โ€บ style
HTML tr style
Sign up and we'll send you the best freelance opportunities straight to your inbox. We're building the largest freelancing marketplace for people like you. ... A style attribute on a <tr> tag assigns a unique style to the table row.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ HTML โ€บ Reference โ€บ Elements โ€บ table
<table>: The Table element - HTML | MDN
November 7, 2025 - In addition to improving accessibility by specifying cell relations, the semantics of the table can be improved by introducing table section groups. Since the first row (<tr> element) contains only column header cells and provides the header for the rest of the table's contents, it can be enclosed in the <thead> element to explicitly specify that row as the head section of the table.
๐ŸŒ
W3Schools
w3schools.com โ€บ tags โ€บ tag_table.asp
HTML table tag
The <tr> element defines a table row, the <th> element defines a table header, and the <td> element defines a table cell. An HTML table may also include <caption>, <colgroup>, <thead>, <tfoot>, and <tbody> elements.
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ html โ€บ html_tr_tag.htm
HTML - <tr> Tag
Each <tr> tag can have one or more <th> tag that specify the table's header cells or one or more <td> tag that define the table's standard cells. The <tr> tag can either be a nested child of the <thead>, <tbody>, and <tfoot> elements or a direct child of the <table> element. ... HTML tr tag supports Global and Event attributes of HTML.
๐ŸŒ
DotFactory
dofactory.com โ€บ html โ€บ tr
HTML tr Tag
A table with 4 <tr> tags: 1 header row (lightblue) and 3 data rows. <style> table.tb { width:300px; border-collapse: collapse; } .tb th, .tb td { padding:3px; border: 1px solid #777; } .tb th { background-color:lightblue; } </style> <table class="tb"> <tr> <th>First Name</th> <th>Last Name</th> </tr> <tr> <td>Denice</td> <td>Hobermann</td> </tr> <tr> <td>Timothy</td> <td>O'Neill</td> </tr> <tr> <td>Jane</td> <td>Hollander</td> </tr> </table> Try it live