dleahy Posted July 5, 2012 Share Posted July 5, 2012 * Having trouble programming my first table. I keep getting ugliness in the FP preview... Can anyone point me in the right direction here? Here is what I have to accomplish: http://postimage.org/image/ak802f4i9/http://s8.postimage.org/z0q5ww591/Screen_shot_2012_07_05_at_4_06_21_PM.png We are going to be utilizing this as a FP template imported in MarcomCentral. The Agenda fields will all be prefilled. Any help is greatly appreciated! Cheers, -Dano Link to comment Share on other sites More sharing options...
Dan Korn Posted July 5, 2012 Share Posted July 5, 2012 Just make a two-column table without any cell borders or margins, and set the text in the first column to green. Something like this: var table = new FPTable; table.AddColumns(6000, 20000); // set column widths here for (var i = 1; i <= 4; i++) { var row = table.AddRow(); row.Cells[0].Content = '<color name="Green">' + TaggedDataField("Agenda Time " + i) + '</color>'; row.Cells[1].Content = TaggedDataField("Agenda Paragraph " + i); row.Cells[0].Margins = row.Cells[1].Margins = { Top:0, Bottom:0, Left:0, Right:0 }; } return table.MakeTags(); Link to comment Share on other sites More sharing options...
dleahy Posted July 6, 2012 Author Share Posted July 6, 2012 Thanks Dan! That's going to save me some serious time. Is there a way to set line height of text or cell height? I couldn't find it in the TablerBuilder tutorial... Getting some serious crunching of type... Here is a screenshot: http://s8.postimage.org/k6o18m8bp/Screen_shot_2012_07_06_at_9_50_08_AM.png Cheers, -Dano Link to comment Share on other sites More sharing options...
Dan Korn Posted July 6, 2012 Share Posted July 6, 2012 Is there a way to set line height of text or cell height? I couldn't find it in the TablerBuilder tutorial... Getting some serious crunching of type... Set the top and bottom margins to something other than zero. P.S. I think I'd skip that dinner. Link to comment Share on other sites More sharing options...
dleahy Posted July 6, 2012 Author Share Posted July 6, 2012 Haha! Ya...I'd skip it too! Alright..I thought it might have something to do with the margins.. Also If I have to add a row that is separate from the dynamic rows. Like so: http://s15.postimage.org/v5ejt2cl7/Screen_shot_2012_07_06_at_11_25_54_AM.png See the Agenda all the way to the far left? Everything else has to stay aligned as is. How can I work the static text "Agenda" into your code on the same row? Cheers, -Dan Link to comment Share on other sites More sharing options...
Dan Korn Posted July 6, 2012 Share Posted July 6, 2012 See the Agenda all the way to the far left? Everything else has to stay aligned as is. How can I work the static text "Agenda" into your code on the same row? Add another column as column 0 and populate it as needed. Add one to the other code to shift the columns over. Link to comment Share on other sites More sharing options...
dleahy Posted July 6, 2012 Author Share Posted July 6, 2012 Ya but how do I stop Agenda from duplicating down the rows and only stay in the first one. http://s7.postimage.org/oedjg6wmj/Screen_shot_2012_07_06_at_12_44_20_PM.png var table = new FPTable; table.AddColumns(0,10810, 5200,7200); // set column widths here for (var i = 1; i <= 5; i++) { var row = table.AddRow(); row.Cells[1].Content = "Agenda"; row.Cells[2].Content = TaggedDataField("Time " + i) + " " + TaggedDataField("ampm " + i) ; row.Cells[3].Content = TaggedDataField("Agenda " + i); row.Cells[0].Margins = { Top:0, Bottom:2, Left:0, Right:0 }; row.Cells[0].Font="SmithNephew"; row.Cells[0].TextColor="Black"; row.Cells[0].PointSize="9"; row.Cells[1].Font="SmithNephew"; row.Cells[1].Margins = { Top:0, Bottom:2, Left:0, Right:0 }; row.Cells[1].PointSize="9"; row.Cells[2].Font="SmithNephew"; row.Cells[2].TextColor="Black"; row.Cells[2].Margins = { Top:0, Bottom:2, Left:0, Right:0 }; row.Cells[2].PointSize="9"; row.Cells[3].Font="SmithNephew"; row.Cells[3].TextColor="Black"; row.Cells[3].PointSize="9"; row.Cells[3].Margins = { Top:0, Bottom:2, Left:0, Right:0 }; } return table.MakeTags(); I surely could benefit from a javascript 101 class or webinar... Link to comment Share on other sites More sharing options...
Dan Korn Posted July 6, 2012 Share Posted July 6, 2012 Ya but how do I stop Agenda from duplicating down the rows and only stay in the first one. ... for (var i = 1; i <= 5; i++) { var row = table.AddRow(); [color=Red] row.Cells[1].Content = "Agenda";[/color] ... Just conditionalize it to only output that for the first row. Replace the line in red above with this: if (i == 1) row.Cells[1].Content = "Agenda";Or: row.Cells[1].Content = (i == 1) : "Agenda" ? ""; Link to comment Share on other sites More sharing options...
dleahy Posted July 6, 2012 Author Share Posted July 6, 2012 Your a legend. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.