Table header cells style

Questions and answers for designing and implementing forms in Servoy

Table header cells style

Postby maria » Wed Jan 19, 2011 1:07 am

Hi guys,

I'm having an issue styling my table headers. In fact, I just don't know how to do it.
What I'd like to have in particular is no borders and different fonts.
grid.png
grid.png (3.79 KiB) Viewed 11465 times

Please help.
The table is a form in table view, no header part, no field labels, so the header is generated automatically by Servoy.

Cheers,
Maria

P.S. I cannot use a header and put header labels there and attach styles to them because I have a background image in my labels css and if I apply that then the label text disappears :? Is it normal? Automatic labels look just fine though but yes, how do I style them?
maria
 
Posts: 424
Joined: Thu Apr 16, 2009 1:18 am
Location: Sydney

Re: Table header cells style

Postby lvostinar » Wed Jan 19, 2011 6:18 pm

Use labelfor label functionality to style the tableview header ( the labelfor label of the field will give the appearance of the corresponding table header).
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am

Re: Table header cells style

Postby maria » Fri Jan 28, 2011 7:14 am

lvostinar wrote:Use labelfor label functionality to style the tableview header ( the labelfor label of the field will give the appearance of the corresponding table header).

Sorry, I don't get it.
When my form is loaded and I try solutionModel.getForm(controller.getName()).getLabels() - I get no labels at all.
How can I use the labelfor if I have no access to the label?
maria
 
Posts: 424
Joined: Thu Apr 16, 2009 1:18 am
Location: Sydney

Re: Table header cells style

Postby ROCLASI » Fri Jan 28, 2011 9:49 am

Hi Maria,

Those labels are not there yet. You need to add them to the form and then link them to their corresponding fields using the 'labelfor' property. (see the wiki for a little more info).
You can add those labels to the form manually (at design time) or by SolutionModel if you want to automate this for your forms.

Hope this helps.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Table header cells style

Postby maria » Tue Feb 01, 2011 5:13 am

ROCLASI wrote:Hi Maria,

Those labels are not there yet. You need to add them to the form and then link them to their corresponding fields using the 'labelfor' property. (see the wiki for a little more info).
You can add those labels to the form manually (at design time) or by SolutionModel if you want to automate this for your forms.

Hope this helps.


Yes, Rob.
If I do what you say - create a label with a proper labelFor property, I can't seem to be able to change the label height or apply a css style to it.
What am I missing here?
Please see the sample solution attached.

Cheers,
Maria
Attachments
test.servoy
(9.93 KiB) Downloaded 374 times
maria
 
Posts: 424
Joined: Thu Apr 16, 2009 1:18 am
Location: Sydney

Re: Table header cells style

Postby martinh » Tue Feb 01, 2011 10:21 am

Can someone please tell what the css format is of tableview headers that are used if you don't have a labelFor label.

In case I have both labels (used for labelFor) and tableviews without specific labels, I want them to show exactly the same.
So that when I've added labels on each form, then I want to restyle the tableview header
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: Table header cells style

Postby martinh » Tue Feb 01, 2011 12:16 pm

It shows the columnheader like this:

Capture.JPG
Capture.JPG (9.57 KiB) Viewed 11339 times


The HTML is like this:

Capture2.JPG
Capture2.JPG (22.36 KiB) Viewed 11339 times


Why is this columnheader only 9px high, while it was created as 70px high?

maria wrote:Please see the sample solution attached.


Maria,

I had to add the following lines in your sample, to make it work:

Code: Select all
   newField.name = "customercontactcode"
   newLabel.text = 'MyText'
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: Table header cells style

Postby maria » Wed Feb 02, 2011 12:45 am

martinh wrote:It shows the columnheader like this:

The attachment Capture.JPG is no longer available


The HTML is like this:

The attachment Capture2.JPG is no longer available


Why is this columnheader only 9px high, while it was created as 70px high?

maria wrote:Please see the sample solution attached.


Maria,

I had to add the following lines in your sample, to make it work:

Code: Select all
   newField.name = "customercontactcode"
   newLabel.text = 'MyText'



Here's what I've got without adding anything:

Untitled.png
Untitled.png (2.02 KiB) Viewed 11316 times


Martin, what do you mean 'to make it work'?
It's not working with or without adding your code - neither the height of the header nor its style.

Could Servoy guys, please, comment on that?

Cheers,
Maria
maria
 
Posts: 424
Joined: Thu Apr 16, 2009 1:18 am
Location: Sydney

Re: Table header cells style

Postby lvostinar » Wed Feb 02, 2011 10:48 am

Some points about these issues:

1. label height is not taken into account for header rendering, this is not supported in 5.2, will be present in 6.0 (so in 5.2 height will always be the default size); maybe you can do some css tricks in 5.2 so the height will be bigger (with margin, for example)
2. @Maria the sample doesn't work well (so styling with solutionmodel labelfor), please create a case with the sample
3. @Martin indeed in webclient the labelor header doesn't get the default css properties (mainly the background image and border); the behavior is different from Smart Client, you can open a case if you want this behavior in webclient also; in order to see the css properties we use on header you can use Firebug (Firefox plugin)
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am

Re: Table header cells style

Postby Karel Broer » Thu Feb 10, 2011 2:41 pm

lvostinar wrote:label height is not taken into account for header rendering, this is not supported in 5.2, will be present in 6.0

Great! So I assume we can define the tableheader in 6 by a seperate style, for example like (?):
Code: Select all
tableheader {
   font-family: Tahoma;
   font-size: 9pt;
   font-weight: normal;
   text-align: left;
        height: 9px;
}
Karel Broer
ServoyCamp - http://www.servoycamp.com
User avatar
Karel Broer
 
Posts: 779
Joined: Mon May 03, 2004 12:49 am
Location: Doetinchem

Re: Table header cells style

Postby lvostinar » Thu Feb 10, 2011 2:46 pm

Karel Broer wrote:
lvostinar wrote:label height is not taken into account for header rendering, this is not supported in 5.2, will be present in 6.0

Great! So I assume we can define the tableheader in 6 by a seperate style, for example like (?):
Code: Select all
tableheader {
   font-family: Tahoma;
   font-size: 9pt;
   font-weight: normal;
   text-align: left;
        height: 9px;
}


No, the height is taken from labelfor label design value. If you style the labelfor label with css those values(that work on normal label) will be applied though.
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am

Re: Table header cells style

Postby Karel Broer » Thu Feb 10, 2011 3:07 pm

lvostinar wrote:
Karel Broer wrote:
lvostinar wrote:label height is not taken into account for header rendering, this is not supported in 5.2, will be present in 6.0

Great! So I assume we can define the tableheader in 6 by a seperate style, for example like (?):
Code: Select all
tableheader {
   font-family: Tahoma;
   font-size: 9pt;
   font-weight: normal;
   text-align: left;
        height: 9px;
}


No, the height is taken from labelfor label design value. If you style the labelfor label with css those values(that work on normal label) will be applied though.

Got that. Thank you.
User avatar
Karel Broer
 
Posts: 779
Joined: Mon May 03, 2004 12:49 am
Location: Doetinchem

Re: Table header cells style

Postby Robert Huber » Thu Feb 10, 2011 4:46 pm

Hi

I support Karel's request for styling a table view column just the standard way in doing it with a css keyword like tableHeader (as Karel suggested) and definig it's properties. The current form with the labelfor is just complicated without any (obvious) advantages.

Karel, have you made a request for this? Would be sensible, wouldn't it.

Thanks and best regards, Robert
Robert Huber
7r gmbh, Switzerland
SAN Developer
www.seven-r.ch
User avatar
Robert Huber
 
Posts: 1239
Joined: Tue Aug 23, 2005 6:52 pm
Location: Schaffhausen, Switzerland

Re: Table header cells style

Postby martinh » Thu Feb 10, 2011 4:56 pm

Robert Huber wrote:I support Karel's request for styling a table view column just the standard way in doing it with a css keyword like tableHeader (as Karel suggested) and definig it's properties. The current form with the labelfor is just complicated without any (obvious) advantages.


I fully agree. I asked exactly the same solution.

To much overhead with that labelFor construction.

Also using css styles, webclient will look (almost) the same as smart client, which is not the case today.
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: Table header cells style

Postby Karel Broer » Thu Feb 10, 2011 6:05 pm

Robert Huber wrote:I support Karel's request for styling a table view column just the standard way in doing it with a css keyword like tableHeader (as Karel suggested) and definig it's properties. The current form with the labelfor is just complicated without any (obvious) advantages.

That's exactly what I would like. Just a standard way to set the tableheader style by CSS.
Karel, have you made a request for this? Would be sensible, wouldn't it.

It would be sensible for sure, Robert. Case 356323 created for this.
User avatar
Karel Broer
 
Posts: 779
Joined: Mon May 03, 2004 12:49 am
Location: Doetinchem

Next

Return to Forms

Who is online

Users browsing this forum: No registered users and 4 guests

cron