I have this table:
<code><table>
<thead>
<tr>
<th>ONE</th>
<th>TWO</th>
<th>THREE</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr class="myDataRow" data-mydata="my data info">
<td>4</td>
<td>4</td>
<td>5</td>
</tr>
<tr>
<td>6</td>
<td>7</td>
<td>8</td>
</tr>
</tbody>
</table>
</code>
<code><table>
<thead>
<tr>
<th>ONE</th>
<th>TWO</th>
<th>THREE</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr class="myDataRow" data-mydata="my data info">
<td>4</td>
<td>4</td>
<td>5</td>
</tr>
<tr>
<td>6</td>
<td>7</td>
<td>8</td>
</tr>
</tbody>
</table>
</code>
<table>
<thead>
<tr>
<th>ONE</th>
<th>TWO</th>
<th>THREE</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr class="myDataRow" data-mydata="my data info">
<td>4</td>
<td>4</td>
<td>5</td>
</tr>
<tr>
<td>6</td>
<td>7</td>
<td>8</td>
</tr>
</tbody>
</table>
With this style:
<code>.myDataRow > td:last-child::before {
content: attr(data-mydata);
}
</code>
<code>.myDataRow > td:last-child::before {
content: attr(data-mydata);
}
</code>
.myDataRow > td:last-child::before {
content: attr(data-mydata);
}
However, “my data info” does not show up before the TD
.
If I do this, however:
<code>.myDataRow > td:last-child::before {
content: "TEST";
}
</code>
<code>.myDataRow > td:last-child::before {
content: "TEST";
}
</code>
.myDataRow > td:last-child::before {
content: "TEST";
}
The word “TEST” shows up fine.
Why is this not working with the data attribute
value?