Hi folks,
As I said before, CSS will never become my BFF ...
In a custom node I have an editableList with two columns and headers for that columns.
But the headers are not properly aligned with the columns below them:
Can get it right by playing with the percentages, but - when I resize manually the config screen - the headers won't stay aligned correctly
Here is my (simplified) code:
$("#node-input-traces-container").css('height','200px').css('min-height','200px').css('min-width','450px').editableList({
header: $("<div>").append($.parseHTML(
"<div style='width:5%; margin-left:5px; display: inline-grid'></div>" +
"<div style='width:45%; margin-left:5px; display: inline-grid'><b>Trace name</b></div>" +
"<div style='width:40%; margin-left:5px; display: inline-grid'><b>Trace type</b></div>" +
"<div style='width:5%; margin-left:5px; display: inline-grid'></div>")),
addItem: function(container,i,trace) {
...
container.css({
overflow: 'hidden',
whiteSpace: 'nowrap'
});
// Add a new row to the html table
var row = $('<div/>', {class:"node-input-trace-div"}).appendTo(container);
// Column 1 : Add a text field to the new row, that represents the trace name (type string)
$('<input/>', {class:"node-input-trace-name", type:"text"}).css({"resize":"none","vertical-align":"top","width":"40%","margin-left":"5px","margin-right":"5px"}).appendTo(row);
// Column 2 : Add a select field to the new row, that represents the trace type (type string).
var traceTypeField = $('<select/>', {class:"node-input-trace-type", type:"text", size:"7"}).css({"width":"33%","margin-right":"10px"}).appendTo(row);
...
},
removable: true,
sortable: true,
addButton: "add trace"
});
Remark: the header section contains 4 div elements (for only two columns) to have open space at the left and right of the header section. Not sure if those need to be fixed (instead of percentage), because I'm not sure whether that will work correctly when the page is being zoomed in/out...
Thanks a lot !!!
Bart