Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Need help making DataTable smaller - CSS style questions.

Expand Messages
  • Satyam
    ... From: Corey Kaye To: Sent: Saturday, December 22, 2007 1:40 PM Subject: [ydn-javascript] Need help making
    Message 1 of 2 , Dec 22, 2007
    • 0 Attachment
      ----- Original Message -----
      From: "Corey Kaye" <kayec@...>
      To: <ydn-javascript@yahoogroups.com>
      Sent: Saturday, December 22, 2007 1:40 PM
      Subject: [ydn-javascript] Need help making DataTable smaller - CSS style

      > Good morning everyone!
      > I have a dataTable object with several columns. The designer is now
      > trying to pretty it up and i've run into a few problems.
      > 1. The ColumnsDefs is not listing to my WIDTH property. Is this
      > measurement in %, EM or PX? I've tried all three and it's still not
      > working. I need these columns to be as tight as possible, including
      > zero cellpadding and cellspacing. Can someone please give me an example
      > of how to skinny this up:
      > var myColumnDefs = [
      > {key:"VisualCheckbox", width:"400em", label:"", sortable:true,
      > resizeable:true, formatter:YAHOO.widget.DataTable.formatCheckbox},
      > {key:"Name", width:"115px", sortable:true, resizeable:true,
      > formatter:YAHOO.widget.Column.formatLink},
      > {key:"PubDay", width:"45%", label:"PUB<br>DAY", sortable:true,
      > resizeable:true}

      Some of the values above are out or range. The browser will ignore them
      since it cannot render them. The Name column has 115px with all right,
      400em is more than a screen width. If it gave 45% to pubday it wouldn't
      have space for the rest. The DataTable adds an attribute to the column
      header like <th style="width:115px" ... it really doesn't analyze or care
      what is it there, it simply adds the attribute blindly without any checking
      or validation. If it doesn't show it is because the browser ignores it.

      > 2. In the last column above to keep it as skinny as possible i've split
      > the column header over two lines. PUB<br>DAY. When this renders PUB is
      > centered but DAY is left justified.???? WHY?

      The resizeable property requires the DataTable to render a little empty
      square to serve as a handle. That little square makes little difference in
      a single lines of enough text but it gets next to the last character in the
      last line so that it shifts the line slightly to the left. When the box is
      far wider than the label, you cannot see it.

      > 3. Lastly. I need to adjust some of the CSSs of a YUI panel. What's
      > the best practice for this? Adjusting the packaged CSS in the YUI
      > sub-folders or applying new CSS tags programmatically?

      Don't touch the distribution files, you can always override both code and
      CSS in your own files, as long as you load your definitions after the ones
      in the distribution. That will spare you lots of trouble when upgrading to
      a new version. Whether you redefine native styles or add styles, it depends
      on what will be your standard. If you will always use a particular style
      for a certain element then override the definition, it is like partially
      redefining your own 'skin', if you are going to change the look of just a
      few elements, add a classname of your own to those elements.


      > Working example:
      > http://www.adatlantic.com/ratecard.php
      > Thanks!!
      > CK
      > Yahoo! Groups Links
      > --
      > No virus found in this incoming message.
      > Checked by AVG Free Edition.
      > Version: 7.5.516 / Virus Database: 269.17.6/1192 - Release Date:
      > 21/12/2007 13:17
    Your message has been successfully submitted and would be delivered to recipients shortly.