tags:

views:

57

answers:

2

hi, i have table unser it i have one td

with elemets inside the menu are coming dynamically from database that is .cs(c#) file i am assging the values ex: i have admin, user, manager like these now i need to assign vertical boder b/w them inside the td like this

|admin| user |manager| as the elements are cmg dynamicallly how to assign border in between them any solution on this would be great thank you

A: 

set border to table and it will automatically set between td's

 <table border="1">
    <tr>
        <td>
        </td>
        <td>
        </td>
    </tr>
</table>
Muhammad Akhtar
+1  A: 

you can use jQuery (for example if you have table with id 'your_table_cell_id_here'), type in your html:

<script type="text/javascript">
  $(document).ready(function() {
    $('#your_table_cell_id_here').css({'border-left' : '1px solid #000000', 'border-right' : '1px solid #000000'});
  });
</script>

or just make a new css style in your .css file:

.table_class td{
  border-left: 1px solid #000000;
  border-right: 1px solid #000000;
}

and don't forget to five your table a class 'table_class'.

ARTstudio
thanks for ur replay ARTstudio $('#your_table_cell_id_here').css({'border-left' : '1px solid #000000', 'border-right' : '1px solid #000000'}); here my td id ="hrmenu" so should i replace that with #your_table_cell_id_here'--> hrmenu
prince23
Yes it will be: $('#hrmenu').css( ...
ARTstudio