How To Hide Empty Columns In HTML Table
Có thể bạn quan tâm
-
- Home
- Questions
- Tags
- Users
- Jobs
- Companies
- Unanswered
- Teams
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Explore Teams Create a free Team - Teams
-
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams How to hide empty columns in HTML Table Ask Question Asked 3 years, 11 months ago Modified 3 years, 11 months ago Viewed 1k times -1So i've got the table below, i want columns to be automatically removed upon the page loading, i should say i am rendering it as PDF. How would i remove the columns that have no data including the header.
<table border="1" cellpadding="6" width="100%" class = "table1"> <thead> <tr> <th title="Field #1">test 1</th> <th title="Field #2">test 2</th> <th title="Field #3">test 3</th> </tr> </thead> <apex:repeat value="{!qli}" var="opp"> <tbody> <tr> <td> <apex:outputText value="{!opp.test1}" /> </td> <td> <apex:outputText value="{!opp.test2}" /> </td> <td> <apex:outputText value="{!opp.test3}" /> </td> </tr> </tbody> </apex:repeat> </table>Any help is appreciated.
Share Improve this question Follow asked Jul 17, 2020 at 15:26 Shaan KhokharShaan Khokhar 237 bronze badges Add a comment |1 Answer
Sorted by: Reset to default Highest score (default) Date modified (newest first) Date created (oldest first) 0Use rendered attribute.
Your code will be
<table border="1" cellpadding="6" width="100%" class = "table1"> <thead> <tr> <th title="Field #1">test 1</th> <th title="Field #2">test 2</th> <th title="Field #3">test 3</th> </tr> </thead> <tbody> <apex:repeat value="{!qli}" var="opp"> <tr> <td> <apex:outputText rendered="{!IF(ISNULL(opp.test1) , false , true)}" value="{!opp.test1}" /> </td> <td> <apex:outputText rendered="{!IF(ISNULL(opp.test2) , false , true)}" value="{!opp.test2}" /> </td> <td> <apex:outputText rendered="{!IF(ISNULL(opp.test3) , false , true)}" value="{!opp.test3}" /> </td> </tr> </tbody> </apex:repeat> </table> Share Improve this answer Follow answered Jul 17, 2020 at 15:46 Noor A ShuvoNoor A Shuvo 4717 silver badges23 bronze badges 1- Would that not just hide the columns rather than the headers? Is there a way to include the headers in that case too. – Shaan Khokhar Commented Jul 19, 2020 at 11:52
You must log in to answer this question.
Not the answer you're looking for? Browse other questions tagged
.- The Overflow Blog
- How to build open source apps in a highly regulated industry
- Community Products Roadmap Update, July 2024
- Featured on Meta
- We spent a sprint addressing your requests — here’s how it went
- Upcoming initiatives on Stack Overflow and across the Stack Exchange network...
Related
3 How do we dynamically add columns in a datatable 1 Trying to create a table (edittable or not) with visualforce from fields that exist within account 0 Hide Columns in a VF Table if variable is chosen 1 SelectRadio in HTML Table forces linebreak 3 hide a table when rendering a PDF 0 Action support on html table 4 Hide HTML table rows if outputField is null or 0 0 Display html table from date wrapper 0 Hide <td> in visualforce page if td is emptyHot Network Questions
- Why should the Vce be half the value of the supply source?
- What's the point of Dream Chaser?
- Con permiso to enter your own house?
- Seeing edges where there are no edges
- 6 balls, one is either heavier or lighter, find the odd ball in minimum weighings
- I want to leave my current job during probation but I don't want to tell the next interviewer I am currently working
- Why would a plane be allowed to fly to LAX but not Maui?
- When did the four Gospels receive their printed titles?
- common.apex.runtime.impl.ExecutionException: Unrecognized base64 character: [
- Can you always extend an isometry of a subset of a Hilbert Space to the whole space?
- Can someone explain the Trump immunity ruling?
- Use of Compile[] to optimize the code to run faster
- Is there a drawback to using Heart's blood rote repeatedly?
- Why does Paul's fight with Feyd-Rautha take so long?
- Staying in USA longer than 3 months
- Do we know a lower bound or the exact number of 3-way races in France's 2nd round of elections in 2024?
- How soon should you apply and unapply the sustain pedal after markings?
- Why does an activated soft fork not invalidate the blockchain?
- Are there examples of triple entendres in English?
- What does a letter "R" means in a helipad?
- exploded pie chart, circumscribing arc, and text labels
- How to handle a missing author on an ECCV paper submission after the deadline?
- Word split between two lines is not found in man pages search
- Who originated the idea that the purpose of government is to protect its citizens?
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
lang-xmlTừ khóa » Html Table Hide Column If Empty
-
Hiding A Table Column If The Containing Cells Are Empty With JQuery
-
How To Hide Empty Table Cells Using CSS? - Designcise
-
Hiding Empty Columns In HTML Table - CodeRanch
-
DataTables Example - Show / Hide Columns Dynamically
-
Hide Row In Html Table If Column Data Is Empty - Domo Dojo
-
DataTables-Hide-Empty-Columns/example-ml At Master
-
How To Hide Empty Columns In Matrix Visual?
-
How To Hide Empty Columns In Table Report - Caspio Forum
-
Altova StyleVision 2022 Enterprise Edition - Tables
-
CSS Empty-cells Property - W3docs
-
Hide Table Column (but Leave Blank Space Where It Would Have ...
-
Showing Hidden Rows And Columns In A Table - IBM
-
Hide Entire Table Row If It Contains An Empty Cell : R/css - Reddit
-
Empty-cells: Hide : Td « Tags « HTML / CSS