Hot answers tagged

24 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 <...
  • 3,675
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}">
14 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 ...
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 ...
  • 7,414
11 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.
10 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 ...
  • 462k
7 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 ...
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 ...
  • 462k
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; } ...
  • 147k
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;...
  • 2,406
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 ...
  • 3,054
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 ...
  • 133k
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 ...
  • 8,666
5 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 ...
  • 54.7k
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 ...
  • 40.7k
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 ...
  • 21.8k
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}...
  • 2,684
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 ...
  • 133k
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"> ...
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.
  • 1,692
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 ...
  • 462k
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> <...
3 votes
Accepted

Visualforce as PDF with table format

A couple of things here - Try set a width on the table and avoid using visualforce styling elements as they're not fully supported by the PDF renderer. Try to stick as much as you can to plain HTML ...
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>&...
  • 66.8k
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}" /...
  • 147k
3 votes
Accepted

Pageblocktable to be rendered as table in PDF

The PDF renderer sensibly skips a lot of styling as the usual Visualforce look isn't something that you're going to want on paper. The pageBlockTable should work but in these situations I do prefer ...
  • 25.1k
3 votes
Accepted

Unable to add new row in Lightning

If you want to create aura:html components dynamically you want to do like this insertNewRow : function(component, event, helper) { $A.createComponents([ ["aura:html", {"tag":"tr", "...
  • 2,684
3 votes

VF page Datepicker position Issue for ScrollableTable

tl;dr: I wasn't able to keep the datepicker position adjusted, but I did find an explanation for why the standard datepicker is behaving the way it is. It took an amount of searching and luck, but I ...
  • 54.7k
3 votes

SLDS table with fixed header

I based this off of the LEX source for reports ;) : helper: handleScroll : function(cmp) { //var thePage = cmp.getElement().getBoundingClientRect(); var tables = cmp.find('table');...
  • 1,781
3 votes
Accepted

How to center lightning:select components in a table

I think that can be solved by adding the variant. <lightning:select aura:id="selectField" name="selectField" label="" variant="label-hidden" onchange="{!c.fieldSelected}" > The space you see ...
  • 7,843

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