Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I set a predefined text content of a table cell in a CSS class?

I tried this:

<style type="text/css">
    td.orange : before { background: #DD5F15; content : "TRIPLE";}
</style>

But I believe it adds the content provided after the closing "td" tag, which is why it doesn't show up. Basically, I just want all the "orange" table cells to just have the text "TRIBLE" inside them.

like image 974
Bogdan Mihai Avatar asked Dec 03 '25 17:12

Bogdan Mihai


1 Answers

You have

td.orange : before { background: #DD5F15; content : "TRIPLE";}

Try this (remove spaces before and after of colon : )

td.orange:before { background: #DD5F15; content : "TRIPLE";}​

Working Example.

like image 124
The Alpha Avatar answered Dec 06 '25 16:12

The Alpha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!