How To Adjust Width Of Columns. | OutSystems
Có thể bạn quan tâm
NannuRank: #2917How to adjust width of columns.4161Views12CommentsSolvedQuestionOutSystems WidgetsHello,
I am trying to display more than 12 columns in the table widget, but it's not showing all of them on the screen. I am building reactive web app.
Do I need to add any style property for Table?
Please suggest me how can I achieve this.
Thank you for your time.
I've implemented it before. The logic is a bit tricky.
In both you need to do a match between human-readable column name and internal name.
Option 1: have an output structure of type text, text, text... to save all the returned values. Your select will be a configurable inline parameter. The table on page will hide columns that are not set.
Option 2: Add a JS plugin to reorder them ( think I used this one in a traditional project). Set the starting string to be what the user wanted. Here you only need to give a unique name to each column.
I may do a video on that, but not for at least a week.
See solution in context0004 Jun 2020Copy comment link
1 reply04 Jun 2020Show threadHide thread
NannuRank: #2917Nuno Reis wrote:
I've implemented it before. The logic is a bit tricky.
In both you need to do a match between human-readable column name and internal name.
Option 1: have an output structure of type text, text, text... to save all the returned values. Your select will be a configurable inline parameter. The table on page will hide columns that are not set.
Option 2: Add a JS plugin to reorder them ( think I used this one in a traditional project). Set the starting string to be what the user wanted. Here you only need to give a unique name to each column.
I may do a video on that, but not for at least a week.
Thank you Nuno for helping me with this. I have found solution in one of your older post. I created one boolean variable for each column and controlled the visibility from checkbox.
1004 Jun 2020Copy comment linkHi Nannu,
You can adjust width (using columns, pixels or percentages) in the styles tab:
1 reply03 Jun 2020Show threadHide thread
NannuRank: #2917Daryna Kravets wrote:
Hi Nannu,
You can adjust width (using columns, pixels or percentages) in the styles tab:
Hi Daryna,
I tried adjusting width in px from default value of Header Cell and Header row for Id Column but it didn't work.
Hello Nannu.
OutSystems and Bootstrap are based in a grid system. It works on a 12 column system so you can split the screen in equal part of 1/2, 1/3, 1/4, 1/6, 1/12, or a mix like 1/3+2/3.
It makes web development very easy, responsive and is easy to read compared with loads of specific CSS.
The disadvantage is that you can't have more than 12 columns by default.
Solution 1:
Do you need more than 12 columns? It seems a waste of space. Filter out some information, leaving only what is relevant. The rest can go on details screen or be exported as excel.
Solution 2: Place the table inside a container and add the css "overflow-x:auto" to make it scrollable.
Solution 3: do your own html/css like in the old days.
0003 Jun 2020Copy comment link
1 reply03 Jun 2020Show threadHide thread
NannuRank: #2917Nuno Reis wrote:
Hello Nannu.
OutSystems and Bootstrap are based in a grid system. It works on a 12 column system so you can split the screen in equal part of 1/2, 1/3, 1/4, 1/6, 1/12, or a mix like 1/3+2/3.
It makes web development very easy, responsive and is easy to read compared with loads of specific CSS.
The disadvantage is that you can't have more than 12 columns by default.
Solution 1:
Do you need more than 12 columns? It seems a waste of space. Filter out some information, leaving only what is relevant. The rest can go on details screen or be exported as excel.
Solution 2: Place the table inside a container and add the css "overflow-x:auto" to make it scrollable.
Solution 3: do your own html/css like in the old days.
Hi Nuno,
I just realized that it's not even showing 12 columns in the table.
I can go with solution 2 but it's making actual content of the table scrollable as well (eg. Big form name).
Thanks.
0003 Jun 2020Copy comment linkBecause some columns are wide (a lot of content) they take more than the bare minimum.
You can always shrink the content (as in, more line breaks). I mentioned the possibility here but never heard back if it works.
Again, 12 columns is ugly. "less is more" "simple is beautiful" and all those made sentences.
0003 Jun 2020Copy comment link
1 reply04 Jun 2020Show threadHide thread
NannuRank: #2917Nuno Reis wrote:
Because some columns are wide (a lot of content) they take more than the bare minimum.
You can always shrink the content (as in, more line breaks). I mentioned the possibility here but never heard back if it works.
Again, 12 columns is ugly. "less is more" "simple is beautiful" and all those made sentences.
Got it,thank you Nuno. To solve this problem is there any way to give controls to the users so that they can select
columns whichever they wanna see?
0004 Jun 2020Copy comment linkI've implemented it before. The logic is a bit tricky.
In both you need to do a match between human-readable column name and internal name.
Option 1: have an output structure of type text, text, text... to save all the returned values. Your select will be a configurable inline parameter. The table on page will hide columns that are not set.
Option 2: Add a JS plugin to reorder them ( think I used this one in a traditional project). Set the starting string to be what the user wanted. Here you only need to give a unique name to each column.
I may do a video on that, but not for at least a week.
0004 Jun 2020Copy comment link
1 reply04 Jun 2020Show threadHide thread
NannuRank: #2917Nuno Reis wrote:
I've implemented it before. The logic is a bit tricky.
In both you need to do a match between human-readable column name and internal name.
Option 1: have an output structure of type text, text, text... to save all the returned values. Your select will be a configurable inline parameter. The table on page will hide columns that are not set.
Option 2: Add a JS plugin to reorder them ( think I used this one in a traditional project). Set the starting string to be what the user wanted. Here you only need to give a unique name to each column.
I may do a video on that, but not for at least a week.
Thank you Nuno for helping me with this. I have found solution in one of your older post. I created one boolean variable for each column and controlled the visibility from checkbox.
1004 Jun 2020Copy comment linkI'm amazed you really only needed hide/show (usually people ask that but later want to change order).
I'm even more amazed that I answered your question six years ago! Glad younger me could help you :)
2004 Jun 2020Copy comment linkjust add this css class on container "overflow-vertical"
1025 Jun 2023Copy comment linkI saw this question now, maybe very late, but here's how I usually use to solve it, you can add this CSS code:
table { table-layout:fixed;}
td { overflow: hidden; text-overflow: ellipsis; word-wrap: break-word;}
2022 Feb 2024Copy comment linkI found another alternative solution,just make the header of your table have more length than its contant
006 days agoCopy comment linkTry OutSystems nowGenerate an App with AITừ khóa » Html Column Width Auto Adjust
-
Auto-Adjusting Column Width In HTML Table - Stack Overflow
-
Column Widths To Auto Adjust For Text? - HTML & CSS - SitePoint
-
CSS Column-width Property - W3Schools
-
CSS Table-layout Property - W3Schools
-
Table-layout - CSS: Cascading Style Sheets - MDN Web Docs
-
Column-width - CSS: Cascading Style Sheets - MDN Web Docs
-
Stop Using To Set Table Width In HTML: Here's Why »
-
Changing Column Width - The Complete HTML5 Tutorial
-
Bootstrap Table Column Width - Bootstrap Helpers - Code Helper
-
Auto Sizing Column Width - SAP Help Portal
-
How Can I Adjust Column Widths In HTML Table Within An Email Body?
-
Bootstrap Table Column Width - Code Helper
-
HTML Table With Auto-fit For Some Columns, Fixed Width For Others
-
Table Auto Width And Height - Tags « HTML / CSS