Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a table and display it on screen, but I want to hide 2 columns without changing the entire view as I may use it later on.

How do I hide with it auto-readjusting the column width, etc.

What I have tried:

HTML
<table class="table-scr" style="width: 100%">
    <colgroup>  
        <col style="width: 10%">  
        <col style="width: 20%">  
        <col style="width: 20%">  
        <col style="width: 30%">  
        <col style="width: 20%">
    </colgroup>
    <tbody>      
        <tr>
            <th>Student ID</th>     
            <th>First Name</th>     
            <th>Last Name</th>     
            <th>Department</th>     
            <th>Major</th>
        </tr>
    </tbody>
    <tbody>
        <tr>  
            <td class="@class">@std_ID</td>  
            <td class="@class">@std_FirstName</td>  
            <td class="@class">@std_LastName</td>  
            <td class="@class">@std_dept</td>  
            <td class="@class">@std_major</td>
        </tr>
    </tbody>
</table>
Posted
Updated 12-Mar-18 6:09am
v3
Comments
F-ES Sitecore 12-Mar-18 10:50am    
The solution depends on how you've implemented it, but you haven't posted any of your code so it's impossible to answer.

1 solution

Simply comment out the columns you don't want to display. Yes, it really is that easy.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900