Fix Column width in tables

Hi,
Anyone of you please update the script for the below requirement.
var doc = app.activeDocument, 
    w = doc.documentPreferences.pageWidth; 
    sel = doc.selection[0];
    if(sel instanceof Table) 
            var col = sel.columns; 
                _left = sel.parent.parentPage.marginPreferences.left; 
                _right = sel.parent.parentPage.marginPreferences.right, allcolwidth = 0; 
            for(var i=1;i<col.length;i++) 
                    var cell = col[i].cells, cont = ""; 
                    for(var j=0;j<cell.length;j++) 
                            cont += cell[j].contents; 
                    if(cont == "") 
                            col[i].width = "1p"; 
                            allcolwidth += col[i].width; 
                    else if(cont.indexOf("$") !=-1) 
                            col[i].width = "1p"; 
                            allcolwidth += col[i].width; 
                    else if(cont.indexOf("*") !=-1) 
                            col[i].width = "1p"; 
                            allcolwidth += col[i].width; 
                    else if(cont.indexOf("%") !=-1) 
                            col[i].width = "1p"; 
                            allcolwidth += col[i].width; 
                   else if(cont.indexOf(")") !=-1) 
                            col[i].width = "1p"; 
                            allcolwidth += col[i].width; 
                    else 
                            col[i].width = "5p"; 
                            allcolwidth += col[i].width; 
                            for(var k=0;k<col[i].cells.length;k++) 
                                    if(col[i].cells[k].contents !="") 
                                            var paras = col[i].cells[k].paragraphs; 
                                            for(var l=0;l<paras.length;l++) 
                                                    paras[l].justification = Justification.RIGHT_ALIGN; 
            col[0].width = w - _left - _right - allcolwidth; 
    else 
            alert("Select a table...") 
All tables in a document:
1) All $, %, ), columns should be fixed width “1p”
2) All empty column should be “1p”
3) All superscript content column like [1, (1), *] should be “1p”
4) Remaining all columns (except first column) should be “6p” width and values are right aligned
5) First column always variable width
6) All underlines values should be 0.5 bottom border, border only need ‘$’ column and ‘value’ column (not in ‘)’ ‘%’ 1, (1), *) columns.
7) Also table should be fit within text area (100%)
The below script is working fine but it missed the requirements for (point no 3 and 6).
Sometimes empty columns are not converted into "1p" because of spanning (see the below table), Can you please ignore the spanned columns while running the script or put any input dialogue box for "number of rows to ignore".

Please do not post drive-by follow-ups to random ancient threads. The Column Width property referred to was introduced in APEX 4.0 in June 2010, 2 months after this thread originated. Whilst the new information might be useful for someone using APEX 4.0 who finds this thread in a search, this question occurs in hundreds of other threads: are you going to update all of them?
And the Column Width property is in the Column Definition section of the column attributes...

Similar Messages

  • Table Autofit - Fixed Column Width not actually fixed when resize viewing window

    Using RoboHelp x8.0.2.208
    Generating HTML help (CHM)
    Set the Autofit property for a table as Fixed Column Width
    Generate the CHM file
    The table starts as the size specified
    If I resize the width of the HTML help viewer, the column width shrinks
    I tested generating this project as WebHelp with the same results
    I also went into the Table Properties and specified a Preferred Width for the overall table and for each column.
    I thought this option would set the size of the table based on how I sized it in source and would not resize the table as the viewing window is resized (either the HTML help viewer for CHM or the web browser window for WebHelp).
    It appears the actual behavior is to start at the size specified and resize columns as the viewing window is resized.
    Can someone tell me if I am not setting something correctly?
    As always, thanks for any assistance/direction.
    Michael F Weart

    The "Autofit" option apparently only applies to the Window size you have specified.
    Once you reduce the window size, the HTML table protocol takes over:
    WARNING, WARNING, WARNING!
    I need "this much" space for the widest element in column 1, and I don't care what your settings are.
    Next, I need "this much" space for the widest element in column 2, and I don't care what your settings are.
    Next, I need "this much" space for the widest element in column 3, and I don't care what your settings are.
    Next, I need "this much" space for the widest element in column 4, and I don't care what your settings are.
    etc.
    etc.
    By "widest element," I mean either an image or the longest text string with no separating spaces (ex: SYSTEM_DIAGNOSTICS_PARAMETER_EXTERNAL_ISSUER).
    If you absolutely have to maintain the table the way you want, you might try creating it in a scrap topic, taking a screenshot, and saving that as a GIF file.
    Good luck,
    Leon

  • RH 10 issue with Fixed Column width

    Hi,
    Is anybody else having issues with setting a fix width for a column in a table?  In RH v.10 the "fixed widths" are not staying "fixed" as I have them manually set.
    I've recently been upgraded from Robohelp (html) v.8 to v.10. 
    In a "Design" view in v.8.0 when I set a column width from the right click menu (AutoFit > Fixed Column Width), the width of the column would be whatever width I'd set it to.  Now, in v.10, the width is whatever width the Robohelp window is set to!  For example, I have a large monitor and I've got Robohelp open in Full Screen mode, the table (a 1-cell table) gets set to the width of the window rather than the particular width I want to use!  I want the cell to be a particular width (much less than my monitor or the open window's width).  Can someone please tell me what I am doing wrong?
    OS=Windows7.
    Browser=IE9
    Robohelp is installed locally (it is not being run over a network).
    Thanks!
    P.S. So far this is the only issue I've had after upgrading from RH v.8 to RH v.10.

    Hi William,
    In a "Design" view in v.10, the table (which is 1 cell) looks like a big rectangular box.  I've turned off the border (cell or table border), so the border appears in gray. 
    Put mouse focus on this 1-cell table, then grab an edge with the mouse. 
    Move the table inward to make the column narrower in the view.
    Then from the right click menu, choose AutoFit > Fixed Column Width.
    Voilá - the width is back to the width of the display window.
    Did that make sense to you?   Thank you for your help and ideas.
    Cheers,
    Julia

  • Is it possible to have a fixed column width and a URL link?

    I am trying to achieve having a popup link on a column within a SQL report but also have the report column a certain width. I can have either or however not at the same time.
    What I did was created a SQL report, edited a column and gave it a URL redirect (page in application) as normal.
    For the fixed column width, I used:
    <div style="width:250px; height:54px; overflow:hidden" title="#Comments#">#Comments#</div>On Column Formatting / HTML Expression
    And for the popup URL, I used:
    onclick="window.open(this.href,'_blank','resizable=0,scrollbars=0,width=650,height=300,menubar=0,location=0');return false;" title="Comments"On the Column Link / Link Attributes

    Andy thank you for your reply, however I either am not completly understanding or there is a problem elsewhere.
    I have changed to the code to fit the needs of the application as so:
    !http://i41.tinypic.com/2m6mrh4.jpg!
    App ID: 523
    Page: 23
    Item: P23_STATUS_COMMENT
    Column to select: Comments
    Whenever clicking on the link, the following error is given:
    Expecting p_company or wwv_flow_company cookie to contain security group id of application owner.
         Error      ERR-7620 Could not determine workspace for application ().{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • PDF Export with fixed column widths ignores page break on Analysis item

    Hi experts,
    we use the column width modification to define fixed column width in a analysis item. On the same Web template we want to export the whole template including the analysis item to PDF format. First of all everything worked properly, but the fixed widths have not been applied to the PDF. According to [SAP Support Note 1336188|https://service.sap.com/sap/support/notes/1336188] and additional explainations from [SDN Thread 1558536|Column Width Modification not working in Print Version; we solved the problem.
    Unfortunately another problem arises. Our Analysis item delivers a big number of rows which extent multiple pages. By applying the export fix width parameter all page breaks are ignored, meaning that the analysis item is never shown completely in the PDF. We tried all parameter options of the Export Function without success. It seems that the EXPORT_FIX_WIDTH is just working for analysis items, which fit on one single page by length.
    Any ideas how to solve this?
    FYI, our XHTML code (Version SAP BW 7.0 SP 19):
    <bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_1">
    <bi:DATA_PROVIDER_REF value="DP_1" />
    <bi:MODIFICATION type="CHOICE" value="MOD_SINGLE_MODULE" >
      <bi:MOD_SINGLE_MODULE type="COMPOSITE" index="1" >
      <bi:ACTIVE value="X" />
      <bi:MOD_SELECT type="CHOICE" value="MOD_GENERIC_MODULE" >
      <bi:MOD_GENERIC_MODULE type="COMPOSITE" >
      <bi:MOD_REFERENCE value="com.sap.ip.bi.rig.ColumnWidth" />
      <bi:MOD_PARAMETER_LIST type="ORDEREDLIST" >
        <bi:MOD_PARAMETER type="COMPOSITE" index="1" >
          <bi:MOD_PARAM_NAME value="COLUMN_DEFAULT" />
          <bi:MOD_PARAM_VALUE type="CHOICE" value="INTEGER" >
            <bi:INTEGER value="50" />
          </bi:MOD_PARAM_VALUE>
        </bi:MOD_PARAMETER>
        <bi:MOD_PARAMETER type="COMPOSITE" index="2" >
          <bi:MOD_PARAM_NAME value="EXPORT_FIX_WIDTH" />
          <bi:MOD_PARAM_VALUE type="CHOICE" value="BOOLEAN" >
            <bi:BOOLEAN value="X" />
          </bi:MOD_PARAM_VALUE>
        </bi:MOD_PARAMETER>
      </bi:MOD_PARAMETER_LIST>
      </bi:MOD_GENERIC_MODULE>
      </bi:MOD_SELECT>
      </bi:MOD_SINGLE_MODULE>
    </bi:MODIFICATION>
    </bi:ANALYSIS_ITEM>
    Any help and comments will be appreciated. Thank you!
    Best regards,
    Sebastian

    Thank you!
    Unfortunately I didn't find any work around.
    Thanks,
    Federico

  • Prob with fixed column widths and word wrapping in viewer

    i have a report where each record has a very long paragraph of text in it.
    In desktop and plus, the text column is at a fixed width and the text just wraps nicely according to the column width.
    But in Viewer, the column widths do not stay fixed, the text does not wrap, and the long text is displayed in a single line that completely stretches the column width off the page and requires a horizontal scroll bar.
    is there anyway to fix the column width in viewer, have the text naturally wrap, and prevent the column stretching. All word wrapping settings are on, but seem to have no effect. I can't seem to find any solution to this.
    Thanks...

    Hi Pritam,
    Per my understanding that you can't see the vertical scrollbar of the ReportViewer controls 2012 to scroll for the grid rows, but can see the vertical scrollbar of the web application, you also can't fix the headers while scrolling, right?
    I have tested on my local environment and can't reproduce your issue, but you have an alternative way to add some css  to the web form's source code to display the vertical scrollbar.
    Details information below for your reference:
    Please check below properties setting of the reportviewer which control the visibility of the scrollbar:
    AsyncRendering="true"
    SizeToReportContent="false"
    Please check if this problem also occur on other version of IE and other type of browser.
    Please check if you have done correct setting of the Fix data to freeze the table header as the step of below:
    http://technet.microsoft.com/en-us/library/bb934257(v=sql.100).aspx
    If step1 doesn't work, please click the source of webform.aspx and add below CSS to add the vertical scrollbar manually:
    #ReportViewer1 {
              overflow-y: scroll;
    Run the application you will see it display as below:
    Similar thread for your reference:
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/f96b3b56-e920-411b-82ea-40467c922e66/reportviewer-control-vertical-scroll-bars
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu

  • Grid with fixed column widths

    Hi Folks,
    I have a grid in which I want to prevent the user to move the set column widths, because this grid has a separate graphik on top of it which would then cease to correspond with the grid columns.
    My question: is there any means of difining a grid with <u><b>non-resizeble columns</b>?</u>
    Thanks & Regards
    Fouad
    Message was edited by: Fouad Sebbane

    Hi
    In the below structure ,set bold field as 'X' for columns u wish to keep fixed.
    Fieldcat
    types: begin of slis_fieldcat_main0,
             row_pos        like sy-curow, " output in row
             col_pos        like sy-cucol, " position of col
             fieldname      type slis_fieldname,
             tabname        type slis_tabname,
             currency(5)    type c,
             cfieldname     type slis_fieldname, " currency
             ctabname       type slis_tabname,   " and table
             ifieldname     type slis_fieldname, " initialcol
             quantity(3)    type c,
             qfieldname     type slis_fieldname, " qty
             qtabname       type slis_tabname,   " and table
             round          type i," round in write statement
             exponent(3)       type c,  " exponent for floats
             key(1)         type c,   " column with key-color
             icon(1)        type c,        " as icon
             symbol(1)      type c,        " as symbol
             checkbox(1)    type c,        " as checkbox
             just(1)        type c,  " (R)ight (L)eft (C)ent.
             lzero(1)       type c,        " leading zero
             no_sign(1)     type c,        " write no-sign
             no_zero(1)     type c,        " write no-zero
             no_convext(1)  type c,
             edit_mask      type slis_edit_mask,            
             emphasize(4)   type c,        " emphasize
       <b>fix_column</b>(1)   type c,       " Spalte fixieren
             do_sum(1)      type c,        " sum up
             no_out(1)      type c,   " (O)blig.(X)no out
             tech(1)        type c,        " technical field
             outputlen      like dd03p-outputlen,
             offset         type dd03p-outputlen,     "offset
             seltext_l      like dd03p-scrtext_l, " long key
             seltext_m      like dd03p-scrtext_m, " middle
             seltext_s      like dd03p-scrtext_s, " short
             ddictxt(1)     type c,        " (S)hort (M)
             rollname       like dd03p-rollname,
             datatype       like dd03p-datatype,
             inttype        like dd03p-inttype,
             intlen         like dd03p-intlen,
             lowercase      like dd03p-lowercase,
           end of slis_fieldcat_main0.
    Regards,
    Raj

  • How to optimize the column width in Table Control

    Hi all,
          When I am displaying fields in Table Control, the columns are displayed in full length, and I am unable to see all the fields at once.
    So as in grid , where we optimize the column width using layout, do we had any property for TC to do so.
    thanks for your help.
    Points would be awarded .
    Regards,
    Anil .

    Hi,
    In Se51, you can do this one, ust open your table control and resize the TC, there is no direct option to do this for entire TC, you need to do this field by field, and arrage the TC to adjust in a Single screen. In the field parameters, you have the field lenghts, there you can minimize the length of a field
    Regards
    Sudheer

  • How to control column width in table?

    I have a table with four columns, and they are all with same width.
    But I want to make one of them wider.
    How should I do?
    public void loadTable(){
    Vector infoList = myObj.getInfoList();
    Info info;
    DefaultTableModel dtm = (DefaultTableModel)myPanel.tblList.getModel();
    String[] columnNames = {
    "wider column",
    "Column B",
    "Column C",
    "Column D"};
    dtm.setColumnIdentifiers(columnNames);
    for(int i=0;i< infoList.size();i++){
    // add stuff to "data"
    dtm.addRow(data);
    myPanel.tblList.setModel(dtm);
    myPanel.tblList.getColumnModel().getColumn(1).setWidth(100);
    I also tried setPreferedWidth(), not working for me either.
    What should I do?
    Thank you

    Try setting all the column widths. Define values for normal and width columns:
            DefaultTableColumnModel tcModel = (DefaultTableColumnModel) myTable.getColumnModel();
            Enumeration columnEnum = tcModel.getColumns();
            while (columnEnum.hasMoreElements()) {
                TableColumn column = (TableColumn) columnEnum.nextElement();
                if (column.getModelIndex()  != 1) {
                    column.setPreferredWidth(narrowWidth);
                } else {
                    column.setPreferredWidth(wideWidth);
    Cheers
    DB

  • How to set column widths in tables for selected table only, not globally throughout document?

    I've been utilizing the below script (thank you so much Ramkumar. P!) to set column widths throughout a sizable InDesign book with tables on every page and it is truly a time saver. At this point in time, I have three versions of it because there are different column widths throughout the book. Is it possible to augment the script to run only on a selected text frame (containing a table)? If so, would someone be kind enough to share the augmented script with me? I've been trying to figure out this seemingly simple change through trial and error with no success as yet. I realize this is a totally newbie request and I'm entirely at the mercy of the kindness of the Javascript gods that contribute within this forum. Seeing that in a different post related to this script, one such guru responded to a request as simple as "Where do I put the scripts in InDesign" gave me enough courage to ask for some help! Thank you in advance to anyone willing to provide a solution.
      var myDoc = app.activeDocument;
         var myWidths = [100, 100, 150, 150];
         for(var T=0; T < myDoc.textFrames.length; T++){
             for(var i=0; i < myDoc.textFrames[T].tables.length; i++){
                 for(var j=0; j < myWidths.length; j++){
                     myDoc.textFrames[T].tables[i].columns[j].width = myWidths[j];
         alert("Table width updated successfully...");

    Hello all
    I have the same problem in that I'm not a scripting person, but was able to get the above script working without problem, and it does set irregular table column widths perfectly, so thanks to Ramkumar. P for that.
    BUT, it changes the column width for ALL tables in the document, whereas I would like to just target the selected table.
    Any ideas as to how I might amend this script to achieve this?
    Thx, Christian

  • Autofit column width to table cell content in Pages

    Hello,
    Would anyone know how to autofit the column width of a table cell in Pages '09?
    I have searched Pages Help to no avail.
    Thank you very much in advance.

    There is a checkbox in the table inspector to auto-resize to fit content. Unfortunately, that only seems to work with rows, not columns.

  • Fixed Column Width in F-32

    Hello Experts,
    We have 'Assignment' column in the clearing screen.  We want to have this column fixed.  The problem is that by default it displays 7 to 8 characters.  If we have more than 8 characters, we have to manually expand the column.  Is there a way to fix the column width to 17 characters?

    Dear Narayan
    Hello Experts,
    We have 'Assignment' column in the clearing screen. We want to have this column fixed. The problem is that by default it displays 7 to 8 characters. If we have more than 8 characters, we have to manually expand the column. Is there a way to fix the column width to 17 characters?
    Go To F-32
    Choose From Menu
    Setting --> Change line Layout
    Double click the layout that appears
    Double click the Assignment Field
    Change the display length to 17 as per your requirement
    and save
    Hope it Solves your query
    Cheers
    IMK

  • Fixed column width in Excel output

    Hi,
    Can we fix a column width when we are viewing the report output in excel? Can we do that in RTF template?
    If the column name is too long, it is automatically inreasing width of the column...But I need the column to be of a fixed width.

    You should try Excel templates instead of RTF templates. This is the best method to control Excel output formatting like column width.did you try excel template ?
    for example for 3 nested group?
    from Re: Can XDODTEXE produce BI Publisher output?
    i tested true excel template on ebs r12.1.2 and it works only for one group and for two group the result awful it duplicate and mix data
    IMHO true excel template very limited yet

  • How to set and fix column widths in Mavericks?

    Until recently I was using a Mid 2011 MBA with OS X 10.8.X.
    I don't know what I did but the column widths in the Finder started to self-adjust to the longest filename.
    Now I have migrated my user account from this MBA to a new MBP running OS X 10.9.1.
    But the Finder in this account still has the same affliction, I can adjust column widths to where I want them but as soon as I click on a file or folder, the column widths readjust to the length of the longest file/folder name.
    How can I stop the Finder from doing that automatically?
    Thanks for your help and Happy Holidays!

    Dear William Lloyd:
    I actually learnt how to do this from another post in this community just a few hours ago.
    You adjust column wisth in Finder by placing your curser at the column edge and while holding Option key down, move column edge to the width you desire.
    This will make a "sticky" change i.e., column widths will stay where you set until you chanage them.
    I would like to to attribute this to the poster I learnt from but I am not able to find that post again.
    Cheers.
    rdfNaresh

  • How to increase column width in Table Maintanance (SE56)

    Hi,
    Can somebody tell me how I can adjust the column width permanently in SE56, so that when I use SM30 to enter data, the columns
    correctly adjusted.
    Thanks,
    mini

    Go to SE80 > Select Function Group > Enter your FG... select your Screen..
    Open the Screen Painter.. change the width of the required column.
    Regards,
    Naimesh Patel

Maybe you are looking for