YUI Datatable Width

This may seem like a basic question, but it's hard for me to figure out how to set the table width to 100% on a YUI-datatable.

I tried to do

#dtContainer {
    width: 100%;
}

#dtContainer table {
    width: 100%
}

but none of these approaches work.

To clarify, I'm trying to set the datatable width to 100% when the table is empty and an empty message is displayed.

The generated table is an HTML table; so I thought it should work.

+5
source share
6 answers

It turns out the solution is really simple:

.yui-dt table
{
    width: 100%;
}
+4
source

.yui-dt {width: 100%;}, . myDataTable.setAttributes({width: "100%" }, true);

+6

.

<script>
window.onload = function() {
setTimeout('document.getElementById("NAME OF CONTAINER DIV").childNodes[1].style.width
= "100%"',1000);
};
</script>

pre render , javascript , post render - , .

+2

, :

 .yui-dt table { width:100%;}
0

, , 100%.

<style type="text/css">

    /* YUI Individual Column Width */        
    #dvAutoWidthList .yui-dt-col-Col1{width: 35%;}
    #dvAutoWidthList .yui-dt-col-Col2{width: 10%;}
    #dvAutoWidthList .yui-dt-col-Col3{width: 15%;}
    #dvAutoWidthList .yui-dt-col-Col4, .yui-dt-col-Col5, .yui-dt-col-Col6, .yui-dt-col-Col7 {width: 10%;}

</style>

PS: , !

Kwex.

0
var dataTable = new Y.DataTable(
          {
            columns: cols,
            data: remoteData,
            width: '100%',             
          }
        ).render('#dataTable ');

. AUI 2.5.1

0

All Articles