Reputation: 682
I have a table where i want to REPLACE the text in the TD but it currently just adds the text to it. Is there any way to replace the text with CSS ONLY? The example below would show "Some new stuffText here" in the TD but I want it to show "Some new stuff" only.
<table>
<tr>
<td data-text="Some new stuff">Text here</td>
</tr>
</table>
CSS:
table td:before {
content: attr(data-text);
}
Upvotes: 0
Views: 46
Reputation: 85545
Use like this:
td[data-text]{
font-size: 0;/*hide the text inside td*/
}
table td:before {
content: attr(data-text);
font-size: 16px;/*show the text of content*/
}
Upvotes: 1