DataList and Border-Collapse
-
Ok, maybe third times a charm. I've posted about this problem before and thought I had an answer but it doesn't work for what I want. Is there anyway to programmatically I can remove the style Border-Collapse:Collapse before the table gets built and sent to the browser? Can I make a Sub that's called by the OnLoad of the DataList or some other On____? I was using javascript that ran on load but it's ugly and inefficient (also with the AJAX I'm using it doesnt always run) EX: document.getElementById('Calendar_DataList1').style.borderCollapse=''; Thanks for any help
-
Ok, maybe third times a charm. I've posted about this problem before and thought I had an answer but it doesn't work for what I want. Is there anyway to programmatically I can remove the style Border-Collapse:Collapse before the table gets built and sent to the browser? Can I make a Sub that's called by the OnLoad of the DataList or some other On____? I was using javascript that ran on load but it's ugly and inefficient (also with the AJAX I'm using it doesnt always run) EX: document.getElementById('Calendar_DataList1').style.borderCollapse=''; Thanks for any help
By design, the DataList control uses the
TableStyle
to apply the style for the control when it is rendered, and the tablestyle basically will emit the the Border-Collapse stuff when the CellSpacing is 0.So there are a couple of options to work around here: + Assign a value (gt&0) to the CellSpacing property of the control. + Define your own custom TabelStyle and override theCreateControlStyle
method of the DataList control. + Override one of the methods called when the control is rendered likeRender
orRenderContents
.... to get rid of the Border-Collapse.