how to strike-through the text, in selected/checked row, in Bootstrap-table,

veeru picture veeru · Sep 10, 2015 · Viewed 19.2k times · Source

I have a Bootstrap-table

<table id="tblTodaysNews"
..
data-click-to-select="true"
data-response-handler="responseHandler">
<thead>
    <tr>
    <th data-field="Select" data-checkbox="true" data-align="center" valign-align="middle" data-width="5px"></th>
    <th data-field="ID" data-visible="false"></th>
    <th data-field="Title" data-title="Title" data-align="left" valign-align="middle" data-width="auto"></th>
    <th data-field="Description" data-title="Message" data-align="left" valign-align="middle" data-width="70%"></th>
    ...     

What i want to do is that when user checks any check-box, in 'Select' data-field, the Title and Description, change their appearance, say, strike-through/Italic. I want to use this ‘checkbox’ to give a visual indication to the user that these rows will be deleted from the database, once user click, a separate, ‘Delete’ button.

Thanks in advance.

Answer

Martin Burch picture Martin Burch · Feb 18, 2017

Try this

tr.selected {
  text-decoration: line-through;
}

Here's a working fiddle: http://jsfiddle.net/e3nk137y/11801/