function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dgindydgindy 

Styles

How do you set the style of a page when showHeaders="false"?  Right now everything comes up as gray. 
Ron HessRon Hess
styling is done with CSS style tags.
jwetzlerjwetzler
When you use our components, particularly the ones that are meant to look like our app (pageBlock, sectionHeader, etc.) they pull in the required stylesheets for you.  Doing something outside of normal salesforce look and feel (removing the header in this case) removes a piece of context that our components sometimes require, and so things might come up looking "gray".

pageBlock and sectionHeader color themselves based on the tabstyle in your page header, so if you don't have the header, you'll lose the color.  You should be able to still specify tabStyle on pageBlock, however, with the name of your entity.

If you want to turn our styles completely off and roll your own, you can use standardStylesheets="false" on your page, but then you should probably not be using pageBlock, sectionHeader, etc, because it's not going to look right, and it might be difficult to override with your own styles.


Message Edited by jwetzler on 06-23-2008 08:38 AM
dgindydgindy
Code:
<apex:page controller="dataController" showheader="false" standardStylesheets="true" tabStyle="Account"  >
<apex:stylesheet value="/resources/htdocs/css/basic.css"/>
<apex:dataTable value="{!Account}" var="CTOB" id="theCTOBTable" rowClasses="odd,even" styleClass="tableClass" cellspacing="2" cellpadding="2">

 
I tried enabling stylesheets but the page still come up "gray".  And I'm assigning the tables a styleclass
Any ideas?
 
jwetzlerjwetzler
Please do not specify the basic.css stylesheet. I'm not sure where that came from and you're not doing anything with it.

You are attempting to use salesforce stylesheets, which is a bad idea in general, because they are not supported and we cannot promise that they will not change out from under you.  Furthermore you are trying to use it with dataTable which is not a salesforce specific component.  Our stylesheets are not designed to behave with these components.

Everything is "gray" to you because you are using our style classes outside of the context of normal salesforce behavior, so they're not going to do what you expect them to.  If you want your table to look like salesforce, you need to use pageBlockTable inside of a pageBlock, and you need to give your pageBlock a tabstyle of "account".

Otherwise if you are going to stick to data table, you need to provide your own stylesheets and your own styles.