/    Sign up×
Community /Pin to ProfileBookmark

Set the background image to right side of column header of Table

how to put the background image at the right side corner of the column header in the table?

the background image is displayed for the whole column header. Not sure what’s wrong.

table.single-line-table {
font: 11px arial, helvetica, sans-serif;
border-collapse: collapse;
border: solid 2px black;
}
table.single-line-table td, .single-line-table th {
border: solid 1px black;
padding: 2px 5px;
}
table.single-line-table th {
text-align: left;
font-weight: bold;
}
table.single-line-table thead tr {
background-color: #9c9;
}
table.single-line-table th.sorted {
background-color: orange;
}
table.single-line-table th a, th a:visited {
color: black;
}
table.single-line-table th a:hover {
text-decoration: underline;
color: black;
}
table.single-line-table th.sorted a, th.sortable a {
background-position: right;
display: block;
width: 100%;
}
table.single-line-table th.sortable a {
background-image: url(../img/arrow_off.png);
}
table.single-line-table th.order1 a {
background-image: url(../img/arrow_down.png);
}
table.single-line-table th.order2 a {
background-image: url(../img/arrow_up.png);
}

table.single-line-table tr.even {
background-color: #ccb;
}
table.single-line-table tr.odd {
background-color: #eec;
}
tr.tableRowEven{
background-color: #9c9;
}

thanks.

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@RxyzauthorNov 08.2005 — Got this working by giving

background-repeat: no-repeat;

in

table.single-line-table th.sorted a, th.sortable a {

background-position: right;

background-repeat: no-repeat;

display: block;

width: 100%;

}
×

Success!

Help @Rxyz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...