Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have issue with table with and fixed headers

help me to do, fixed header.

If dynamic columns are more than one its woking good as above image. If getting not good design where there is only one like below image:

enter image description here

Here is an html

<table id="gridcostpool11" class="gridexcel table table-condensed table-bordered tableSection" style="margin: 0 0 0 0 !important; padding: 0 0 0 0 !important; border-width: 0 0 0 0 !important; box-shadow: 0 0 0 0 !important; border-spacing: 0 0 0 0 !important;">
        <thead>

            <tr>
                <th style="width: 125px;"></th>
                <th style="width: 305px"></th>
                <th style="width: 105px;"></th>
                <th style="min-width:102px;" ng-repeat="(key,val) in quantities">{{val.RequestQuantity}}</th>
                <!--<th style="min-width:102px;" ></th>-->
            </tr>
            <tr>
                <th style="width: 125px;min-width: 125px;">LineItem</th>
                <th style="width: 305px;min-width:305px;">Description</th>
                <th style="width: 105px;min-width: 105px;">QtyPerBoard</th>
                <th ng-repeat-start="(key,val) in quantities" style="min-width: 115px">Unit $</th>
                <th ng-repeat-end style="min-width: 100px;width:165px;">Total $</th>
            </tr>
        </thead>
        <tbody>

            <tr ng-repeat="pur in purchases">
                <td style="width:125px;min-width:125px; " >{{pur.ItemNo}}</td>
                <td style="width:305px;min-width:305px;">{{pur.LineItemDescription}}</td>
                <td style="width:105px;min-width:105px;" id="qtyPerBoard_{{pur.LineItemId}}">{{pur.QtyPerBoard}}</td>
                <td ng-repeat-start="(key,val) in pur.Quantities" style="min-width:115px;width:118px;">
                    <a id="unit_{{val.QuantityId}}_{{pur.LineItemId}}" ng-click="openSuppliersPopUp(val.QuantityId,pur.LineItemId,val.QuantitiesSuppliersId)">{{ val.SelectedPrice == null?'Select Rate': val.SelectedPrice}}
                    </a>

                </td>
                <td ng-repeat-end style="min-width:130px;width:165px;">
                    <label id="total_{{val.QuantityId}}_{{pur.LineItemId}}">
                        {{val.SelectedPrice * pur.QtyPerBoard | number:3}}
                    </label>
                </td>
            </tr>

            <tr>
                <td style="width:125px;min-width:125px;" ></td>
                <td style="width:305px;min-width:305px;  "></td>
                <td style="width:105px;min-width:105px;" >
                    <label><strong>
                        Total </strong>
                    </label>
                </td>
                <td ng-repeat-start="(key,val) in totalPrices" style="min-width:115px;width:118px;">
                    <label id="totalPerUnit_{{val.QuantityId}}">
                        {{  val.TotalSelectedPrice | number:3}}
                    </label>

                </td>
                <td ng-repeat-end style="min-width:130px;width:165px;">
                    <label id="totalQty_{{val.QuantityId}}" >
                        {{ val.TotalQtyPerBoardPrice | number:3}}
                    </label>
                </td>
            </tr>

        </tbody>

    </table>

And Here is the css

  table.tableSection {
   display: table;
    width: 100%;
}
table.tableSection thead, table.tableSection tbody {
    float: left;
    width: 100%;
}
table.tableSection tbody {
    overflow: overlay;
    overflow-x:hidden;
    height: 150px;
}
table.tableSection tr {
    width: 100%;
    display: table;
    /*text-align: left;*/
}
share|improve this question
    
Your HTML and CSS would be useful here. –  Spencer Wieczorek yesterday
    
hi all, i am new to stackoverflow. please don't give negative vote to my question. Thanks –  Aniket yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.