I inherited some code that takes in a data source and renders that data as a HTML table as such:
<table>
<tr>
<td>Mrs</td>
<td>Jane</td>
<td>Fonda</td>
</tr>
<tr>
<td>Mr</td>
<td>William</td>
<td>Shakespeare</td>
</tr>
</table>
I would like the last table cell td content (Fonda, Shakespeare) to display as a new row beneath its original row. Is there a way to accomplish this via CSS?
2
Answers
it cannot be done without javascript. but still I did my best. I hope you can benefit from it and improve it.
I know it might not be exactly what you want.
https://jsfiddle.net/zj8r1amh/1/
You can try this code. Note that I am note using classes or id (just tag name) you can be more pecific in targetting by looking at the class or the id for selecting table and row. The initial code has been edited to better answer the question