I am attempting to generate an HTML table where both column count and width can be customized. I am also wanting to be able to bind specific columns from a table to their corresponding columns...
Example Schema:
[Invoice].[Quantity]
[Invoice].[ItemName]
[Invoice].[TotalAmount]
Originally, I was trying to mess with passing in an object with two properties (both Dictionaries).
Something like this:
public class CustomObject {
public Dictionary<string, int> THTitle_Width { get; set; }
public Dictionary<string, string> InvoiceColumn_CorrespondingTHTitle { get; set; }
}
My thought wanting to achieve something like:
THTitle_Width.Add("My Quantity Header", 100);
InvoiceColumn_CorrespondingTHTitle.Add("Quantity", "My Quantity Header");
Idea being that data within the [Invoice].[Quantity] column would then be known to fall under the table column "My Quantity Header" which in turn has a width of 100 (px).
This would then output:
<tr><th style="width:100px;">My Quantity Header</th></tr>
<tr><td>1</td></tr>
<tr><td>15</td></tr>
<tr><td>3</td></tr>
etc...
Reason being, you could just pass in this custom object and everything beyond that is handled. Is this possible? Maybe not in this way, but in another?
Thank you for any help/ideas you are able to give!
Example Schema:
[Invoice].[Quantity]
[Invoice].[ItemName]
[Invoice].[TotalAmount]
Originally, I was trying to mess with passing in an object with two properties (both Dictionaries).
Something like this:
public class CustomObject {
public Dictionary<string, int> THTitle_Width { get; set; }
public Dictionary<string, string> InvoiceColumn_CorrespondingTHTitle { get; set; }
}
My thought wanting to achieve something like:
THTitle_Width.Add("My Quantity Header", 100);
InvoiceColumn_CorrespondingTHTitle.Add("Quantity", "My Quantity Header");
Idea being that data within the [Invoice].[Quantity] column would then be known to fall under the table column "My Quantity Header" which in turn has a width of 100 (px).
This would then output:
<tr><th style="width:100px;">My Quantity Header</th></tr>
<tr><td>1</td></tr>
<tr><td>15</td></tr>
<tr><td>3</td></tr>
etc...
Reason being, you could just pass in this custom object and everything beyond that is handled. Is this possible? Maybe not in this way, but in another?
Thank you for any help/ideas you are able to give!