Magento Expert Forum - Improve your Magento experience

Results 1 to 5 of 5

How to add Serial No. to first column of specific Table only

  1. #1
    Junior Member kajal's Avatar
    Join Date
    Sep 2014
    Location
    Bangalore
    Posts
    1,446
    Thanks
    0
    Thanked 20 Times in 20 Posts

    Default How to add Serial No. to first column of specific Table only

    I have many tables on dashboard also I have fullCalender(fullCalender uses table on UI) on dashboard. All I need is to have serial number in first column of specific table only, it can be identified by either id or class,

    <style>
    table { counter-reset: Serial; }
    table { border-collapse: separate; }
    tr td:first-child:before { counter-increment: Serial; content: counter(Serial).; }
    </style>
    but it give serial numbers to all the table that exists on UI including fullCalender.

    View more threads in the same category:


  2. #2
    Junior Member
    Join Date
    Sep 2016
    Posts
    228
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    I accomplished it using below css code,

    <style>
    .serialTable { counter-reset: Serial; }
    .serialTable { border-collapse: separate; }
    .serialTable tr td:first-child:before { counter-increment: Serial; content: counter(Serial); }
    </style>



    Small Business for Sale | Business for Sale in Delhi

  3. #3
    Junior Member
    Join Date
    Feb 2018
    Posts
    113
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    <%! int i = 1; %>
    <tbody>
    <c:forEach var="row" items="${model}">
    <tr>
    <td><%= i; %> <%! i++; %> <td>
    <td>HTML</td>
    <td style="word-break:break-all;">Mount</td>
    <td>1234</td>
    <td>2345</td>
    <td style="word-break:break-all;">2345</td>
    <td>token</td>
    <td>right</td>
    <td>10982</td>
    </tr>
    </c:forEach>
    </tbody>

    try this jsp code.

    in Sql Try this

    SELECT @a:=@a+1 serial_number,marks,(need fields in you db) FROM
    student_marks(your db name),(SELECT @a:= 0) AS a;



    Book Ad in Newspaper | Newspaper Ad Agency in Lucknow
    Last edited by trzy; 16-11-2020 at 09:46 AM.

  4. #4
    Junior Member
    Join Date
    Sep 2016
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by vishnu View Post
    I accomplished it using below css code,

    <style>
    .serialTable { counter-reset: Serial; }
    .serialTable { border-collapse: separate; }
    .serialTable tr td:first-child:before { counter-increment: Serial; content: counter(Serial); }
    </style>



    Small Business for Sale | Business for Sale in Delhi
    Well this is the right one. I completely agree with your reply.

  5. #5
    Junior Member
    Join Date
    Sep 2018
    Location
    Oman, Muscat
    Posts
    2,084
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default

    Presently, I additionally need a section which returns sequential numbers alongside it. The sequential Only the put away proc playing out the capacity will be affected. You can make brief table having one personality segment, col 2?.insert all fields you needed.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •