Why we can't include <td> tag before <tr> tag? | Sololearn: Learn to code for FREE!


Why we can't include <td> tag before <tr> tag?

for example: <table> <td> <tr> sam</tr> <tr>good</tr> </td> </table> The output should be : sam good but it don't happen.

3 Answers

New Answer


What's the reason you want td precedes tr, against the standard format?


I thought that we use td tag for going another column and use tr tag for going another row. So if we use a td tag and under td tag if we use multiple tr tag , for every tr tag the program will go another row of that column.


tr tag is a row creator tag that create a row and contains cells not text . it contains element node (th and td) not text node. you are coding to get so. which is not possible. you have to code two tr with td in each tr to get your desired result.