Hot answers tagged

19 votes
Accepted

Lightning Web Component for table rows and cells

Building on the answer provided already by @sfdcfox, this following seems to be working for me and allows me to componentize the entire row (much easier to emit events this way). parent.html <...
user avatar
  • 3,585
17 votes
Accepted

Apex:OutputText to Currency Format from String Wrapper

The problem was you misspelled currency. This works fine and avoids hard coding the currency symbol: <apex:outputText value="{0, Number, Currency}">
user avatar
13 votes
Accepted

SLDS table with fixed header

The SLDS table header row can be fixed using standard classes. There are two classes that are important slds-table–header-fixed_container and slds-cell-fixed and i created a working example on github ...
user avatar
12 votes

Apex:OutputText to Currency Format from String Wrapper

From my comment: <apex:outputText value="${0, number, ###,###,##0.00}"> works as well. The hashes display numbers in that position if they exist. So it will display $3.14 instead of $000,003.14 ...
user avatar
  • 7,326
11 votes
Accepted

Nested table using pageblock

You need to use breakBefore and colspan parameters of the apex:column: <apex:pageBlock> <apex:pageblocksection title="Order Lines" showheader="true" collapsible="true" columns="1"> &...
user avatar
  • 21.7k
10 votes
Accepted

How to add page breaks to visual force page rendered as pdf so that a dynamically rendered list in apex repeat tag does not strech the table lines

I found an easy solution for the problem, no need to implement any logic for the same just included the following attribute -fs-table-paginate: paginate; in tables style tag and worked like a miracle.
user avatar
9 votes

Lightning Web Component for table rows and cells

Ideally, you shouldn't use table; lightning-layout and lightning-layout-item work as tables for all practical purposes. If that doesn't work for you, then you'd want to simply apply the appropriate ...
user avatar
  • 434k
8 votes

How to make a "join" between two tables?

Try this : SELECT Id, description, title, [...] FROM Product2 WHERE Id in (SELECT Product2Id FROM PricebookEntry) AND reference LIKE '%MyProductRef%');
user avatar
  • 3,526
7 votes

Apex:OutputText to Currency Format from String Wrapper

You need to use <apex param> along with <apex:outputText> by specifying the proper parameters for it to be output in. Here's an example from the VF Developer's Guide: <!-- For this ...
user avatar
  • 40.4k
6 votes
Accepted

<tr> and <td> tags within <apex:repeat> rendering above the table?

You need to use outputText instead of outputPanel. outputPanel is intended to be used as reRender targets, and to group content together. The documentation for outputPanel states: A set of content ...
user avatar
  • 434k
6 votes
Accepted

Create PageBlockTable With Two Types Of SObject

Just use a List<SObject> property. Your controller should look something like: public with sharing class MyController { public List<SObject> tasksAndNotes { get; private set; } ...
user avatar
  • 143k
6 votes
Accepted

Overlapping data while using print functionality over VF page

I believe this is happening due to the table falling on a page-break-zone. You can add the following style style="page-break-inside: avoid;" to your div inside the apex:repeat, it will ensure no ...
user avatar
6 votes

Lightning Web Component for table rows and cells

I agree with most statements from the comments where there are better choices than a table but another option I found is to use the following CSS in your "row" component: :host{ display: contents;...
user avatar
  • 2,386
5 votes
Accepted

Visualforce table column headers of headers

Very first link from my google results has it all: <apex:facet name="header"> <table border="1" width="100%"> <tr> <td width="50%" rowspan="2">Other ...
user avatar
  • 3,044
5 votes
Accepted

wrapper data not showing in lightning component

Instead of e.g.: value="{!v.con.janTotal}" for your case it is just e.g.: value="{!con.janTotal}" Inconsistently, the v. prefix is required to access aura:attribute values but not to access the ...
user avatar
  • 130k
5 votes
Accepted

Combine two lists in to one visualforce table

Create a wrapper class to represent the object they share in common. That seems to be the Commission__c field. public class CommissionWrapper { // May need to be lists public ...
user avatar
  • 8,554
4 votes

How to add page breaks to visual force page rendered as pdf so that a dynamically rendered list in apex repeat tag does not strech the table lines

What you want to do typically requires a custom controller. There's an excellent tutorial in the Technical Library titled Creating Professional PDF Documents with CSS and Visualforce that describes ...
user avatar
  • 40.4k
4 votes
Accepted

move TD to new TR

In order to create a layout like you want you can use a nested pageBlockSection element. The first "wrapper" section has only one column and the nested section - two. A simple combibation of those ...
user avatar
  • 21.7k
4 votes

alternating row colors in a VF table rendered as PDF

One simple way to give alternating colors for a table is to use <apex:dataTable classes="odd,even">. then add the below css code: <style> .odd { background-color:#FFFF66; } ....
user avatar
  • 41
4 votes
Accepted

Perform actions on a table in a Lightning Component

you may use tabindex to get index from Lighting:button <lightning:button tabindex="{!index}" class="deleteButtons" label="del" iconName="utility:delete" iconPosition="left" onclick="{!c.deleteRow}...
user avatar
  • 2,676
4 votes

Rowspan with apex repeat

Examples such as this one HTML rowspan Attribute reduce the number of td elements in the following rows (as rowspan is effectively saying use the content from the previous row). So you need to ...
user avatar
  • 130k
4 votes
Accepted

Justify text based on width of column width lightning design grid (slds)

You can use the Hyphenation from SLDS. The hyphenation class should be placed on text that might be served in narrow width containers and is not truncated. <div class="slds-grid slds-gutters"> ...
user avatar
4 votes
Accepted

lightning:input vertical alignment in table cell

Use <lightning:input variant="label-hidden"> to have lightning input without a space in front.
user avatar
  • 1,672
4 votes
Accepted

Lightning: <table> with dynamic column count, want fixed width columns and scrolling instead of automatic resizing

Table elements always expand to take up all available space. Instead, you'll want to use normal div elements. I'm not going to try and build a perfectly working example, but you'll want to start off ...
user avatar
  • 434k
4 votes
Accepted

Display Tables side by side in Visualforce - Render As PDF

This is getting a bit cross-discipline, as this is primarily a html/css/layout issue. I'll skip going over details about the "box model". In short, tags get rendered as boxes. From outside ...
user avatar
  • 48.4k
4 votes
Accepted

For each in HTML not working

It looks like your variable references are not quite right. Please use different variable names for each reference to avoid confusion. Existing: There is no rn nor rn.contracts. <tbody> <...
user avatar
3 votes
Accepted

How to prevent refreshes from blowing out sobjects and tables

I suggest that you add a field to the SObject called something like "ApplicableOrganizationId" and then route all access through a method that looks something like this: public String getCallbackUrl()...
user avatar
  • 130k
3 votes

Nested repeats + table + if + pdf = frustration

A simpler approach is to make use of the map-like syntax available for SObjects (see the get/put in sObject Class). So if you arrange for the field API names that you want to show to be in a list ...
user avatar
  • 130k
3 votes

Using nested apex:repeat and pageBlockTable in a page

Your prog variable is actually a record, not an index. It represents co in your Apex parallel. <apex:repeat value="{!myMap[data][emp]}" var="co"> <apex:outputText value="{!co.Field__c}" /...
user avatar
  • 143k
3 votes
Accepted

Using nested apex:repeat and pageBlockTable in a page

I had trouble making this work with pageBlockTable (or dataTable) but I could with apex:repeat Using this controller property with unimaginative accountNames: public map<Date,List<Account>&...
user avatar
  • 62.4k

Only top scored, non community-wiki answers of a minimum length are eligible