Hide Table Column (but Leave Blank Space Where It Would Have ...
Có thể bạn quan tâm
- Fit window
- Fit width
- 50%
- 75%
- 100%
- 125%
- 150%
- 200%
Hide Table Column (but leave blank space where it would have appeared)
Version 10 Forms Updated August 7, 2017 Subscribe Subscribed asked on August 7, 2017I have a form that has two tables. The first is returning lookup data from a sql table and will have several rows. The second table exists to total the rows from the first table and is fixed to one row. The issue I am having is that the first field in both tables is "Date" (I just copied the first table to create the second one), which obviously will not be totaled. I want to have the total columns in the second table appear directly underneath their corresponding columns in the first table, so I would like to just hide the column name and the input cell but leave the blank space to that the other cells line up properly. If I hide the table column using field rules, it moves everything over and spaces out the columns, which doesn't work for this application.
If anyone can tell me how to hide this table column but pad the row so that the spacing still works, I would really appreciate it. For now I can just hide the column label using javascript, but the input box still appears, which doesn't look professional.
0 0 Post Link Answer SELECTED ANSWER replied on August 7, 2017 • Show version historyI would do this with pure CSS instead of JavaScript since CSS seems to work better when the time comes to store a copy of the form.
You can also target the columns based on name, but you would need to specify the table if you did that since there are technically two "Date" columns.
For example, similar to what Rob said, grab the #q value of the column (not the Table), then you could do the following:
#q100 label, [data-col="q100"] > * { display:none; }The > * selector will make sure it hides anything under that data column, including the date picker, without hiding the wrapper or changing the size/spacing.
Although it is probably not the way to go in this case since you have multiple tables using the same column names, for future reference you can also use the "data-title" attribute to grab the fields from a specific column:
#q100 label, [data-title="Column Name"] > * { display:none; } 2 0 Post Link Replies Sort by: Most popular- Most popular
- Oldest to newest
- Newest to oldest
Hi Melanie,
This snippet should do the trick:
$('#q100 label, .date input, .date img').remove();Directly target the row header via the ID associated with it (so, replace '#q100' with whatever ID is used on your form) . Add the CSS class 'date' (or whatever you want to call it) to the 'Date' field on the table:
That should do it!
~Rob
1 0 Post Link SELECTED ANSWER replied on August 7, 2017 • Show version historyI would do this with pure CSS instead of JavaScript since CSS seems to work better when the time comes to store a copy of the form.
You can also target the columns based on name, but you would need to specify the table if you did that since there are technically two "Date" columns.
For example, similar to what Rob said, grab the #q value of the column (not the Table), then you could do the following:
#q100 label, [data-col="q100"] > * { display:none; }The > * selector will make sure it hides anything under that data column, including the date picker, without hiding the wrapper or changing the size/spacing.
Although it is probably not the way to go in this case since you have multiple tables using the same column names, for future reference you can also use the "data-title" attribute to grab the fields from a specific column:
#q100 label, [data-title="Column Name"] > * { display:none; } 2 0 Post Link replied on August 7, 2017Thank you to both Rob and Jason for this excellent information. I ended up using the CSS only, and it worked perfectly, both for the display of the form and for the saved version inside Laserfiche.
0 0 Post Link You are not allowed to follow up in this post. Sort by: Most popular- Newest to oldest
- Most popular
- Oldest to newest
- Condensed
- Expanded
- All
- Resolved
- Unresolved
Sign in to reply to this post.
Subscribe Subscribed Details- Asked August 7, 2017
- Updated August 7, 2017
- 2048 views
- {fileName} {fileName}
- View
- Download
- Go to post
- Delete
Post Editors
OK CancelVersions
Từ 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
-
How To Hide Empty Columns In HTML Table
-
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
-
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