jQuery example to underline all cells in the first column of a table
Just 3 lines of code and some CSS job will do the trick.
by Duke Dinh
HTML
<table class="jqst" style="display: block;">
<thead>
<div class="dropdown" align="left">
<p></p>
</div>
</thead>
<tbody>
<tr rowid="123456789" width="500">
<th class="table-head" scope="col">AP Name</th>
<th class="table-head" scope="col">AP Model</th>
<th class="table-head" scope="col">Base Radio Mac</th>
<th class="table-head" scope="col">Admin Status</th>
<th class="table-head" scope="col">Operational Status</th>
<th class="table-head" scope="col">Number of Radios</th>
<th class="table-head" scope="col">Group Name</th>
<th class="table-head" scope="col">Country</th>
</tr>
<tr rowid="123456789" width="500">
<td rowid="fuckyou" class="first-column">AP Floor 1-1</td>
<td>1240AG-N-K9</td>
<td>C4:0A:CB:24:3C:D0</td>
<td>Enabled</td>
<td>Up</td>
<td>2</td>
<td>12</td>
<td class="last-column">US</td>
</tr>
<tr rowid="thisisthedamid" width="500">
<td class="first-column">AP Floor 1-2</td>
<td>042N</td>
<td>D4:0A:CF:25:3C:D1</td>
<td>Enabled</td>
<td>Up</td>
<td>2</td>
<td>12</td>
<td class="last-column">US</td>
</tr>
<tr rowid="thisisthedamid" width="500">
<td class="first-column">AP Floor 1-3</td>
<td>1240AG-N-K9</td>
<td>E4:0A:CG:26:3C:D2</td>
<td>Enabled</td>
<td>Up</td>
<td>2</td>
<td>12</td>
<td class="last-column">US</td>
</tr>
<tr rowid="thisisthedamid" width="500">
<td class="first-column">AP Floor 1-4</td>
<td>042N</td>
<td>F4:0A:CH:27:3C:D3</td>
<td>Enabled</td>
<td>Up</td>
<td>2</td>
...
CSS
.jqst {
background-color: #ffffff;
border-collapse: collapse;
font-family: Helvetica, Verdana, sans-serif;
font-weight: 300;
width: 100%;
font-size: 12px;
background-clip: padding-box;
}
.jqst > thead {
/** DEFINE toolbar styles here **/
}
.jqst > thead .layout td {
font-weight: 500;
}
.jqst > thead td {
border: 1px solid #bbbbbb;
padding: 4px;
background-color: #ddd;
color: #333333;
padding-top: 6px;
padding-bottom: 6px;
}
.jqst > thead tr.title > td {
text-align: center;
}
.jqst > thead tr.toolbar td {
background-color: #fefefe;
padding: 0px;
}
.jqst > thead tr.toolbar input.filter {
width: 200px;
border-radius: 12px;
border: 1px solid #bbbbbb;
font-size: 12px;
font-color: #666;
padding: 2px;
margin: 4px;
vertical-align: top;
}
.jqst > thead tr.toolbar .menu {
display: inline-block;
position: absolute;
top: 85px;
color: #ffffff;
padding: 8px;
font-size: 16px;
width: auto;
background-color: #2ac5eb;
text-align: left;
}
.jqst > thead tr.toolbar .hover {
background-color: rgba(0, 0, 0, 0.05);
cursor: pointer;
}
.jqst > thead tr.toolbar .button {
vertical-align: top;
display: inline-block;
border-right: 1px solid #bbbbbb;
width: 30px;
text-align: center;
padding: 2px;
height: 100%;
}
.jqst > tbody > tr {
border-bottom: 1px solid #e5e5e5;
/* HOVER */
/* EDITING STUFF */
}
.jqst > tbody > tr:nth-last-child(1) {
border-bottom: 1px solid #bbbbbb;
}
.jqst > tbody > tr:nth-child(odd) {
background-color: #fbfbfb;
}
.jqst > tbody > tr:nth-child(even) {
background-color: #fefefe;
}
.jqst > tbody > tr .jqst-hover-row {
background-color: #D0EDF2;
}
.jqst > tbody > tr .jqst-hover-row td.editable {
background-color: transparent;
}
.jqst > tbody > tr .editable {
font-weight: bold;
cursor: pointer;
}
.jqst > tbody td {
/* border-right: 1px solid #bbbbbb; */
...
JavaScript
$(document).ready(function () {
$('.jqst').delegate("tr td:first-child", "click", function (
{
alert($(this).text());
});
});