html - Make all buttons on a td show into same line while keeping it shrunk -
i'm using tables represent tabular data app listings.
on each row, on first cell, draw several buttons allow users activate de record (edit, delete, enter de detail view, etc...).
number of buttons on td can vary, same on every table row.
so i'd first column fits number of buttons shown on table.
i'm applying class buttonsblock { min-width:1px; } these cells, on table disposition (depending of space occupied rest of cells) buttons fall second line, instead of being together.
example html of table
<table> <tr> <th></th> <th>field a</th> <th>field b</th> <th>field c</th> <th>field d</th> <th>field e</th> </tr> <tr> <td class="buttonsblock"> <a href="actionbutton1url"> <button type="button" class="btn btn-default btn-xs"> <span class="glyphicon glyphicon-arrow-right"></span> </button> </a> <a href="actionbutton2url"> <button type="button" class="btn btn-default btn-xs"> <span class="glyphicon glyphicon-file"></span> </button> </a> <a href="actionbutton3url"> <button type="button" class="btn btn-default btn-xs"> <span class="glyphicon glyphicon-th-list"></span> </button> </a> </td> <td>data field a</td> <td>data field b</td> <td>data field c</td> <td>data field d</td> <td>data field e</td> </tr> </table>
so... let's depending on table i'm showing , permissions user in session has, can show different number of buttons. i'd buttons place in single line, can giving fixed width buttonsblock class, however, i'd td fit lesser space possible.
just now, depending on space occupied data on tds e , number of buttons, buttons show on single line or, sometimes, last button drops new line.
any ideas?
try adding white-space: nowrap
table cell holds buttons:
.buttonsblock { white-space: nowrap; }
demo here: http://jsfiddle.net/5smm8/
(also, i'm not sure why have anchor wrapping button.)
Comments
Post a Comment