You could achieve that if you use th:style to set your style attribute:

<div th:style="'background:url(' + @{/<path-to-image>} + ');'"></div>

Check this thread on thymeleaf forum.

Answer from Leandro Carracedo on Stack Overflow
🌐
DotFactory
dofactory.com › html › th › style
HTML th style
In HTML, the style attribute on a th element assigns a unique style to that element.
🌐
W3Schools
w3schools.com › tags › tag_th.asp
HTML th tag
The <th> tag also supports the Event Attributes in HTML. ... <table style="width:100%"> <tr> <th style="text-align:left">Month</th> <th style="text-align:left">Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself »
Discussions

Setting CSS style attributes with thymeleaf - Stack Overflow
How to set the background property of a style tag with a thymeleaf resolved url. More on stackoverflow.com
🌐 stackoverflow.com
html - Style <th> with classes in CSS - Stack Overflow
I have some trouble with HTML tables. My table looks like the following: More on stackoverflow.com
🌐 stackoverflow.com
Style table row with TH + TD - HTML & CSS - SitePoint Forums | Web Development & Design Community
Is there an easy way to style a table row which has both a TH and TD’s? Rain Coat Child's Yellow $39.99 If I add a class to TR then it just styles the TD’s. And it’s a pain to have to add a class to TR and the TH. ☹ More on sitepoint.com
🌐 sitepoint.com
0
January 5, 2021
html - style tag with Thymeleaf - Stack Overflow
Assuming you want the link styled as a header, you can surround the link with

and use Thymeleaf's th:style to achieve what you want:

More on stackoverflow.com
🌐 stackoverflow.com
🌐
Codecademy
codecademy.com › forum_questions › 53a473a552f863a0f3000b31
Style attribute to <tr> and <th> tags? | Codecademy
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>TABLE, TR or TH/TD</title> <style> table { width: 100%; } tr { background-color: #def; } th { background-color: #cba; } td { width: 30%; height: 30px; color: red; background: transparent; } </style> </head> <body> <!-- very basic table for illustration only --> <table> <tr> <th>Lorem</th> <th>Ipsum</th> <th>Dolor</th> </tr> <tr> <td>Lorem column text</td> <td>Ipsum column text</td> <td>Dolor column text</td> </tr> <tr> <td>Lorem column text</td> <td>Ipsum column text</td> <td>Dolor column text</td> </tr> </table> </body> </html>
🌐
o7planning
o7planning.org › 12373 › thymeleaf-th-class-th-classappend-th-style-th-styleappend
Thymeleaf th:class, th:classappend, th:style, th:styleappend | o7planning.org
th:style will create a the style attribute (or replace the available style attribute) during generating HTML by the Thymeleaf Engine.
🌐
HTML Tables
htmltables.io › tags › th
HTML <th> Tag — Web Reference (2024)
May 28, 2024 - This CSS snippet styles <th> elements with a light gray background, bold text, a border, and adequate padding for better visual appeal.
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › HTML › Element › th
<th>: The Table Header element - HTML - MDN Web Docs
<table> <tr> <th scope="col">Symbol</th> <th scope="col">Code word</th> <th scope="col">Pronunciation</th> </tr> <tr> <th scope="row">A</th> <td>Alfa</td> <td>AL fah</td> </tr> <tr> <th scope="row">B</th> <td>Bravo</td> <td>BRAH voh</td> </tr> <tr> <th scope="row">C</th> <td>Charlie</td> <td>CHAR lee</td> </tr> <tr> <th scope="row">D</th> <td>Delta</td> <td>DELL tah</td> </tr> </table> Some basic CSS is used to style the table and its cells.
🌐
W3docs
w3docs.com › learn-html › html-th-tag.html
HTML th Tag - Learn HTML | W3Docs
If you want to display the first row of the table as labels or headings, for the content in the table’s first row you must use <th> elements instead of <td> elements. By default, the content of the <th> tag is bold and centered. To change its look, you can use CSS styles.
🌐
Quora
quora.com › What-does-th-mean-in-style-tag-in-html
What does th mean in style tag in html? - Quora
Answer (1 of 19): style used for making websites with applicable styles. In HTML every element(line) has attributes like font type,color, width,height,margin, border..etc. To define values for this attributes HTML uses the style tag. There are three ways to define style in HTML. 1).In the same li...
🌐
Thymeleaf
thymeleaf.org › doc › tutorials › 2.1 › usingthymeleaf.html
Tutorial: Using Thymeleaf
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"> <head> <title>Good Thymes Virtual Grocery</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" media="all" href="../../css/gtvg.css" th:href="@{/css/gtvg.css}" /> </head> <body> <p th:text="#{home.welcome}">Welcome to our grocery store!</p> </body> </html>
🌐
Lenovo
lenovo.com › home
The Role of HTML `<th>` Tag in Tables | Lenovo US
Set the white-space property to normal or wrap for the <th> tag or its container. This allows the text to wrap within the cell instead of overflowing. For example, you can use th { white-space: normal; } in your CSS stylesheet to enable text wrapping within <th> tags.
🌐
GeeksforGeeks
geeksforgeeks.org › html › html-th-width-attribute
HTML &lt;th&gt; width Attribute - GeeksforGeeks
September 16, 2024 - The HTML <th> width Attribute is used to specify the width of a table header cell.
🌐
SitePoint
sitepoint.com › html & css
Style table row with TH + TD - HTML & CSS - SitePoint Forums | Web Development & Design Community
January 5, 2021 - Is there an easy way to style a table row which has both a TH and TD’s? <tr> <th>Rain Coat</th> <td>Child's</td> <td>Yellow</td> <td>$39.99</td> </tr> If I add a class to TR then it just styles the TD’s. And it’s a…
🌐
W3C
w3.org › MarkUp › html3 › tablecells.html
Table Cells (TH and TD)
This distinction gives user agents a means to render such cells distinctly, for instance by using a larger or heavier font for header cells. It is also needed when rendering to speech. The CLASS attribute can be used to further differentiate cells, for instance into heads and subheads. This can be used together with style sheets to control the cell border style, and fill color etc.
🌐
TechOnTheNet
techonthenet.com › html › elements › th_tag.php
HTML: <th> tag
The HTML <th> tag defines a header cell that can appear in the first row of an HTML table. Browsers traditionally render the text found within the <th> tag as bold, center-aligned text.
🌐
Tutorialspoint
tutorialspoint.com › html › html_th_tag.htm
HTML - <th> Tag
Let's look at the following example, where we are going to consider the basic usage of the <th> tag. <!DOCTYPE html> <html> <style> table, th, td { border: 2px solid #D2B4DE; } </style> <body> <table> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>Maya</td> <td>23</td> </tr> <tr> <td>Ravi</td> <td>22</td> </tr> <tr> <td>Ram</td> <td>21</td> </tr> </table> </body> </html> Consider the following example, where we are going to use the colspan attribute along with the <th> tag.
🌐
Instagram
instagram.com › th.style
Instagram
We cannot provide a description for this page right now