I'm trying to put all the info about each cell in a table in a single line. And I need to figure out how to print the header of each column in the table.
td, table {
border: 2px black solid;
}
<table>
<tr>
<td>a1</td>
<td>a2</td>
<td>a3</td>
<td>a4</td>
</tr>
<tr>
<td>b1</td>
<td>b2</td>
<td>b3</td>
<td>b4</td>
</tr>
<tr>
<td>c1</td>
<td>c2</td>
<td>c3</td>
<td>c4</td>
</tr>
<tr>
<td>d1</td>
<td>d2</td>
<td>d3</td>
<td>d4</td>
</tr>
</table>
Table 1
+----+----+----+----+
| a1 | a2 | a3 | a4 |
+----+----+----+----+
| b1 | b2 | b3 | b4 |
+----+----+----+----+
| c1 | c2 | c3 | c4 |
+----+----+----+----+
| d1 | d2 | d3 | d4 |
+----+----+----+----+
Table 2
+----+----+----+----+
| e1 | e2 | e3 | e4 |
+----+----+----+----+
| f1 | f2 | f3 | f4 |
+----+----+----+----+
| g1 | g2 | g3 | g4 |
+----+----+----+----+
| h1 | h2 | h3 | h4 |
+----+----+----+----+
And Other Tables ...
I want to get the cells printed with the cell at the top of the column (i.e. tr[1]).
The output shouldn't have the first raw ..
The first output should be:
The cell b1 has the header a1
..
The cell g2 has the header e2
and so on ..
I'm using xidel:
xidel $site -e "//tr[position()>1]/td/concat('The cell ', ., $codeX)"
What the value of $codeX
should be?
Thanks,