php - By using tablesorter how to specify th td size? -
i using below code
<table class="tablesorter custom-popup"><thead><tr> <th class="filter-false" data-sorter="false"></th> <th>host</th><th>status</th><th>place</th> <th>local content</th><th>user</th><th>drive</th> <th>capable</th><th>test</th><th>customer</th><th ">info</th>
for columns th info , local conttent has 2 words of data.that time th displaying big.i need restrict specific columns th td size.
any solutions appreciable.thanks in advance.
to limit column widths, set column size using css
do either adding class names each column:
html
<th class="filter-false narrow" data-sorter="false"></th> <th class="host">host</th> <th class="status">status</th> <!-- ... --> <th class="info">info</th>
css
.narrow { width: 25px; } .host { width: 100px; } .status { width: 50px; } /* ... */ .info { width: 100px; }
or using pure css (you need target 1 header row)
.custom-popup th:nth-child(1) { width: 25px; } .custom-popup th:nth-child(2) { width: 100px; } .custom-popup th:nth-child(3) { width: 50px; } /* ... */ .custom-popup th:nth-child(11) { width: 100px; }
alternatively, can add <col>
defined width inside <colgroup>
<table class="tablesorter custom-popup"> <colgroup> <col style="width:25px"> <col style="width:100px"> <col style="width:50px"> <!-- ... --> <col style="width:100px"> </colgroup> <thead> <!-- ... --> </thead> <tbody> <!-- ... --> </tbody> </table>
Comments
Post a Comment