Page 1 of 6
hiding 1st column of table field
Posted: Sun Nov 20, 2022 5:09 pm
by marksmithhfx
Hi, I am trying to hide the 1st column of a table field (I do have a workaround if this does not work).
I set the tab stops of the field to 0, 300, 525, 750, etc
However instead of hiding the first column I see a column of maybe 2-3 pixels wide at the left edge of the table. I checked the firstindent (it's 0) and LC says the table does not have a leftindent property. Anything else to try before I go to my plan B?
Thanks
Mark
Re: hiding 1st column of table field
Posted: Sun Nov 20, 2022 6:16 pm
by FourthWorld
The indents affect paragraphs. For object margins try the leftMargin.
Let me know if that doesn't do it. I've done zero-width columns before, so I know there's a recipe somewhere. Hopefully my memory of that is all you'll need.
Re: hiding 1st column of table field
Posted: Sun Nov 20, 2022 6:17 pm
by dunbarx
Hmmm.
I tried a bunch of things. The logical solution would be just as you described, setting the first tab to 0. Even tried "0,0..."
Setting to -1 was the worst of my experiments.
Is your plan B to overlay something over column 1?
Craig
Re: hiding 1st column of table field
Posted: Sun Nov 20, 2022 6:31 pm
by dunbarx
I believe, though others may actually know, that the table field itself has a lower limit to its tabStops.
@Richard. I tried setting the leftmargin to 0 but that only moved the text all the way to the left. It did not hide the first tab.
Craig
Re: hiding 1st column of table field
Posted: Sun Nov 20, 2022 6:33 pm
by dunbarx
AHA.
But if you set the tabStops to, say "0,50" (or ",50") AND the leftMargin is set to 0, the first tab is hidden.
Craig
Re: hiding 1st column of table field
Posted: Sun Nov 20, 2022 6:36 pm
by dunbarx
It turns out this is a technique, if such a one is ever needed. You can hide any number of the leading tabs. To hide, say, the first three tabs, set them to "0,0,0,50".
And we know that one can hide interior tabs in the usual way, for example "0,50,50,100" would hide tabs 1 and 3
Craig
Re: hiding 1st column of table field
Posted: Sun Nov 20, 2022 9:51 pm
by FourthWorld
dunbarx wrote: ↑Sun Nov 20, 2022 6:33 pm
AHA.
But if you set the tabStops to, say "0,50" (or ",50") AND the leftMargin is set to 0, the first tab is hidden.
Thank you for clarifying. Yes, I'd intended to suggest leftMargin as a replacement for leftIndent, but not also as a replacement for tabstops. That zero-width column specifier in tabstops is the magic, the rest is just alignment.
Re: hiding 1st column of table field
Posted: Mon Nov 21, 2022 1:34 pm
by marksmithhfx
Thank you all. That was the formula (tabstop = 0 with leftMargin = <something small>). leftMargin = 0 did hide the first column (when tabstop was set to 0) but also cut off a few pixels of the first letter in the next column. I found a setting of leftMargin = 2 worked best (hiding the tab stop line, but allowing a pixel or two of breathing space for the first letter in the next column). Thanks so much for pointing me in the right direction. (it saved a lot of coding effort to implement plan B, which was not as simple as hiding a column).
Cheers,
PS for the curious, the first column showed row numbers (array indices) as a result of "combine array by return and tab". The row numbers were of little use to the end user but since the purpose of the app is re-ordering rows in an array, the row numbers were used in a "Reset" function if you wanted to throw away any changes (NOTED: there are other ways of doing this... exiting without saving is one option, for example). However with the row numbers sitting there it was easy to implement. The workaround was to combine array by return which loses the array indices / row numbers and then simply add a sequential row number column with values 1..N somewhere else less visible (column 8 for example). Hiding the first column meant no other adjustments to the code while the workaround had lots of steps. The upside of Plan B is it would have engaged me in trying to discover which of LC's many statements would fill a column with values 1..N the fastest. An exercise now left for a future date.
Re: hiding 1st column of table field
Posted: Mon Nov 21, 2022 5:22 pm
by FourthWorld
Well done, Mark. Thank you for the confirmation, and the use case background. That sort of thing is very helpful to newcomers.
Re: hiding 1st column of table field
Posted: Tue Nov 22, 2022 8:29 pm
by marksmithhfx
FourthWorld wrote: ↑Mon Nov 21, 2022 5:22 pm
Well done, Mark. Thank you for the confirmation, and the use case background. That sort of thing is very helpful to newcomers.
Thanks Richard, however...
I ended up going with Plan B and here's why (a tale told in 3 stacks)
Mark
Re: hiding 1st column of table field
Posted: Tue Nov 22, 2022 9:40 pm
by dunbarx
Mark.
That is some kludge. I hate it, though I admire it.
So have we decided that no shenanigans we know of will hide column 1 yet still yield control of the text attributes of that field? I hoped that setting the textAlign property would help, but not nope.
Craig
Re: hiding 1st column of table field
Posted: Tue Nov 22, 2022 10:00 pm
by bn
Mark,
The only way I can think of is to
Code: Select all
set the padding of line 1 to -1 of field "myTable" to 3
You could play with the numbers.
But that also pads above and below the lines.
Kind regards
Bernd
Re: hiding 1st column of table field
Posted: Tue Nov 22, 2022 10:56 pm
by dunbarx
Bernd.
That does indeed help a little. The issue with padding is it works on all four "sides" at once, so that any value above 2 or so starts to make the cells themselves grow out of proportion.
You would think that with all the many properties available, some combination would allow the first column to be hidden and the look of the remaining parts seem normal. There may yet be some bunch of settings that will allow the OP not to have to cheat the way he does.
Craig
Re: hiding 1st column of table field
Posted: Tue Nov 22, 2022 11:02 pm
by bn
tabAlign can also be an option.
Code: Select all
set the tabAlign of field 1 to "left,center,right"
Kind regards
Bernd
Re: hiding 1st column of table field
Posted: Tue Nov 22, 2022 11:33 pm
by dunbarx
Bernd.
Getting there.
Mark.
Can you live with centered text? With this handful of settings, you would not have to pluck out the data in column 1. I personally would prefer anything rather than having to manage that.
Craig