IText trouble with automatically adjustment of table width

With iText I an producing a PDF file with some elements. One of these is a table which is supposed to be centered.
In this table 2x2 with input form a Servlet. This input is a string of variable length, in other words I do not know the length of it.
I want this table to automatically adjust the cells width according to the length of the String. As I understand iText does not posess this functionality.
This is how I have created the table: The first column has a width of 0.3 because the values in those I allready know. The default value is centered and 80% span, and because of this the table is not centered according to the text since the content contains empty space, but the 80% span table is centered.
PdfPTable table = new PdfPTable(2);
float[] widths = { 0.3f, 0.8f };
table.setWidths(widths);How could I calculate this? The string has a font size of 22pt. Could I check for the number of chars in the String and adjust the width accordingly? It seems like I need to set the table.setWidthPercentage(50) in addition to the width size. But if I dont know the relationship between the width and percentages.
If I calculate the width to be 0.6f with font size 22 and length x, how much percentages should I use?
Message was edited by:
DJ_Viking
Message was edited by:
DJ_Viking

You need to use FontMetrics. In particular, use the FontMetrics of the table's renderer component so the string width will be calculated correctly even if the cell's value is bold. Something like this:
Component comp = table.getDefaultRenderer(Object.class).getTableCellRendererComponent(table, cellValue, false, false, row, column);
FontMetrics fm = comp.getFontMetrics(comp.getFont());
int cellWidth = fm.stringWidth(cellValue);
table.getColumnModel().getColumn(column).setWidth(cellWidth);

Similar Messages

  • Problems with Automatic Adjust row height in FRs ver. 11.1.2.1.103

    Hi
    We have just upgraded to 11.1.2.1.103 from 9.3.3.
    .103
    We had a fairly complex report that worked in the previous environment, but not anymore.
    We have a number of text lines with that pulls from other lines in the report that are hidden.
    It is celltext that we are reporting on.
    The lines are setup, so the row height should just adjust depending on the amount of text, but it does no longer work for consecutive lines with the adjust row hight atribute swithed on. I now have to insert blank text lines with a fixed height in between to get it to work.
    It makes the report the report look messy, so has anyone had similar issues and know a work around or a possible patch.
    KR
    Per

    Okay,
    I tried that I when I tried to use: sqlplus -s I got the following results
    SQL> sqlplus -s
    SP2-0042: unknown command "sqlplus -s" - rest of line ignored.
    I am also still getting the following in my output:
    Any other suggestions?
    SQL> Select
    2 'Siebel CVP' as Source_Name,
    3 'RCI' AS Brand,
    4 'Phone' AS Channel,
    5 'Inquiry' AS EBR_Type
    6 FROM dual;
    Siebel CVP RCI Phone Inquiry
    SQL> set head on
    SQL> Select
    2 substr(con_home_ph_num,1,10) AS Chan_Addr,
    3 'No EBR Date' As EBR_date,
    4 substr(x_rccl_brand,1,3) AS Brand,
    5 'Phone' AS Channel,
    6 substr(con_person_uid,1,21) AS Src_Id,
    7 substr(x_rccl_source,1,23) AS EBR_source,
    8 'Inquiry' AS EBR_Type
    9 FROM
    10 siebel.eim_contact
    11 WHERE
    12 con_home_ph_num is not null and
    13 con_home_ph_num > '201'
    14 and length (con_home_ph_num) = '10'
    15 and con_home_ph_num <> '0'
    16 and con_home_ph_num <> '1111111111'
    17 and con_home_ph_num <> '9999999999'
    18 and con_home_ph_num <> '0000000000'
    19 and con_home_ph_num NOT LIKE '+%'
    20 and con_home_ph_num NOT LIKE '0%'
    21 and con_home_ph_num NOT LIKE '123%'
    22 and con_home_ph_num <> '2222222222'
    23 and x_rccl_call_type is null
    24 and x_rccl_brand = 'RCI'
    25 and TO_DATE(TO_CHAR(x_rccl_entry_date, 'MM/DD/YYYY'), 'MM/DD/YYYY') >= TO_DATE(TO_CHAR(sysdate, 'MM/DD/YYYY'), 'MM/DD/YYYY')
    26 and x_rccl_source IN ('CTI','CTI_GVS','CTI_HOTWEB','CTI_PRE_SHOPPING_CALL','DIR_PASTGUEST_RECONNECT')
    27 ORDER BY
    28 con_home_ph_num asc
    29 /
    CHAN_ADDR EBR_DATE BRA CHANN SRC_ID EBR_SOURCE
    EBR_TYP
    5167350937 No EBR Date RCI Phone Prospect - 1-3IIJ-218 CTI_PRE_SHOPPING_CALL
    Inquiry
    8054977010 No EBR Date RCI Phone Prospect - 4861358 CTI_PRE_SHOPPING_CALL
    Inquiry
    SQL> spool off

  • Trouble with passing values into table !

    Well my problem seems to be very small but have tried a lot of books and e-books to get a possible solution, but all in vain.
    The problem is I have a table, lets say 'tab', which has a varchar2 column, lets say 'col'.
    I want to be able to make an insert into this 'col' column of the table 'tab'.
    Simple inserts with all symbols work fine. But when I run the following insert, it fails.....
    insert into tab
    values('abcn&def');
    Assume the table tab has a single column 'col' of varchar2 datatype. When I run the insert statement it prompts a value. Is there anyway I can store '&' as a part of the data?

    In SQL*Plus ampersand character (&) is the default character to identify a parameter.
    Either use set define off or set define to a different character.
    SQL > set define off
    --- this will turn off & as the input parameter definition charatcer
    or use
    SQL > set define *
    -- this will set * as the input parameter definition charatcer instead of &
    Shakti
    (http://www.impact-sol.com)
    (Developers of Guggi Oracle)

  • Trouble with DataGrid's last column width

    I have a datagrid with thirty columns.
    When I use the mouse to drag the window and resize its size,the last column width becomes more and more wide,and the previous column width is squeezed small.
    If anybody else came accross the same problem,can you share your solution?
    Thanks,
    April

    If horizontalScrollPolicy=”off” then there is an attempt to fit all columns within the width of the DG while respecting minWidth of the columns.  Make sure the minWidths allow the columns you want to shrink can shrink.
    However, there is still a chance of round-off error.  I think the only solution may be to set the width of each column as you want it on a resize event from the DG.

  • Trouble with disappearing image in table --

    This is totally weird and I can't figure out why it's
    happening.
    I'm new to DW8, although I have used a much older version of
    DW a lot.
    No matter how I create the header for
    http://www.amafca.org/convertedindex.htm,
    the very top banner image is getting stripped when I put the page
    online for testing.
    Currently, I'm using a table, where the img src is correctly
    listed as table data for that cell. Test perfectly locally. Then I
    use ACE FTP 3 to upload the page to the website for testing. All
    the graphics are where they are supposed to be. BUT...the top
    portion of the banner isn't showing up! Looking at the source code,
    the "img src" link for that cell is totally empty -- the code has
    been stripped from the page!!!!!
    How is that possible? Is ACE FTP doing it? How and why? (I've
    never even heard of an ftp program stripping out code!!!)
    I suppose I need to just go ahead and wade through getting
    the DW ftp set up so I can use it for this test page, and see if
    the info is still being stripped. But has anyone heard of this sort
    of thing happening before?
    Thanks
    Pam at amafca

    The only way the code could disappear is if your antivirus
    strips it out.
    When I browse to your link, I think I see all of the images.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "patinven" <[email protected]> wrote in
    message
    news:ecct1l$3dt$[email protected]..
    >I have the same problem over here. Images in a table will
    not display
    >anymore
    > from my PC. On other PC's (tested 1) the images display
    correctly. When I
    > look
    > at the source code (from within IE) of the uploaded file
    >
    http://www.copacabanapromotie.com/nl_lin.htm
    ) the <img src> definitions
    > have
    > all disappeared. The file displays OK in local view, and
    the <img src>
    > definitions are there.
    > However in my case the image files do not have "strange"
    names, I do not
    > run
    > Norton, and turning off my virus checker and/or firewall
    does not help
    > either.
    > Any ideas?
    >

  • Problem with automatic table of contents Level headings

    I am having trouble with the Table of contents in Adobe Indesign. When I create my automatic table of contents one of the Level headings that is supposed to appear under Chapter 1 instead appears under the Introduction heading. On the actual page where the heading paragraph styles have been defined the 2nd Level heading is as it should be underneath Chapter 1. So what I end up having to do is move them manually in the TOC. But I don’t want to have to do this and it would be great if Indesign instead did the automatic table of contents correctly.
    I wonder if it has anything to with the fact that our template is set up with headings (that sit outside the body text to the left) as text boxes which we place inside the main body text box (they have anchored object settings on them so the heading sits off to the side).  Whilst the anchored text box is exactly in the right sequence, maybe indesign senses and reads the anchored text box last?
    I have an example of the file and the problem that is occurring in the pdf, it can be downloaded from:
    Is there a solution to this?  If anyone has any ideas I would be very grateful.

    I've been playing with this for a while, and quite honestly I don't understand why it's doing things the way it is. It's working correctly on Page 11, which seems to me to have exactly the same structure, except for the subtitle. It also works correctly if I copy the frames from page 14 and paste into a new doc.
    Things I tried that did not work: Export as .inx and move the pages to a new doc. You might try copying the text and pasting into a new doc.

  • Suddenly cannot adjust table width via sizing handles

    I have found the cause of this, and it is rather bizarre:
    Using Structured FM, 10.0.2.419, on a Windows 7 Ultimate (32-bit) OS.
    Today I noticed I cannot resize table columns in the usual way, by selecting more than one row in the column and dragging the sizing handles that appear at the edge of the column.  The sizing handles appear there when rows are selected, but I cannot "grab" them.  Instead, when I try to click on a handle, the row selection is lost.  The table has no straddled columns or rows, no hidden/conditional text.  I have tried on several different types of tables all with the same non-result.  The document is otherwise editable.
    I am forced to use the Resize Column dialog box, which is not so fast or easy as just grabbing the column edge and visually adjusting it.
    I have rebooted my machine with no change in the problem.
    ====================
    Resolution:
    The problem appears to occur when I have various panels/pods open (and set to stay open, not iconify after use).  In this case I was working with conditional text, deleting some no-longer-used conditions from my documents.  I had three conditional text panels open in my workspace, ADD/EDIT CONDITION TAG, SHOW/HIDE CONDITIONAL TEXT, and CONDITIONAL TEXT.  The last two were "merged" into a single panel, and all panels were set permanently open using the double right-arrows in the panel dark frame at the top.
    It turns out when I collapse some or all of these open panels, I can select the table resize handles and adjust the column widths visually.  When I have all three pod panels expanded, the resize handles are ungrabbable.
    Forgive me if I'm not using "pod" and "panel" precisely accurately - I just use them (or more often try to work around them) rather than worrying about the names Adobe has chosen.  By giving users SO much flexibility, I personally think they have made an awful usability mess of the product.
    In any case, the problem seems to be solved, and I am posting this in case it can be helpful to anyone else.
    Thanks.
    -- garyZ

    This sounds like a bug. Please post a formal bug report here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform The engineers can't fix it if they don't hear about it.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices    

  • Is Acrobat Pro right for us. We have an Employee Handbook that needs editing. Some is current pdf, some from an older version. Want to get all into one handbook, have the table of contents automatically adjust and link to specific pages from the ToC.

    Is Acrobat Pro right for us. We have an Employee Handbook that needs editing. Some is current pdf, some from an older version. Want to get all into one handbook, have the table of contents automatically adjust and link to specific pages from the ToC.

    You can download the trial version (http://helpx.adobe.com/acrobat/kb/acrobat-downloads.html) to convert the PDF back to WORD if you do not have the original. The conversion may not be perfect, but it is typically better than starting from scratch. You may be lucky and get a good result. You might check the settings (in the save screen) to try retain format versus retain text flow. The format version can be a pain to edit since it creates a bunch of text boxes. The flow version may require you to reformat in WORD, but you likely would want to do that anyway.

  • Trouble with RFC table input

    Greetings Experts,
    I'm having trouble with calling an RFC with table input.
    Here is my code so far:
      public void executeZps_Fm_War_Mat_Update_Input( )
        //@@begin executeZps_Fm_War_Mat_Update_Input()
              //$$begin Service Controller(344531631)
              IWDMessageManager manager = wdComponentAPI.getMessageManager();
              try {
                   int size =
                        wdContext
                             .nodeZps_Fm_War_Mat_Prefill_Input()
                             .nodeWarOut()
                             .nodeEx_Warout()
                             .size();
                   for (int i = 0; i < size; i++) {
                        IPublicWARComp.IEx_WaroutElement srcElement =
                             wdContext
                                  .nodeZps_Fm_War_Mat_Prefill_Input()
                                  .nodeWarOut()
                                  .nodeEx_Warout()
                                  .getEx_WaroutElementAt(i);
                        IPublicWARComp.IIm_WarmatinElement trgElement =
                             wdContext.createIm_WarmatinElement(
                                  new com.kaisa.mwci.models.updatezpsmur.Zps_War());
                        WDCopyService.copyCorresponding(srcElement, trgElement);
                        wdContext
                             .nodeZps_Fm_War_Mat_Update_Input()
                             .nodeIm_Warmatin()
                             .addElement(
                             trgElement);
                   wdContext
                        .currentZps_Fm_War_Mat_Update_InputElement()
                        .modelObject()
                        .execute();
                   wdContext.nodeOutWarMatIn().invalidate();
              } catch (WDDynamicRFCExecuteException e) {
                   manager.reportException(e.getMessage(), false);
              //$$end
        //@@end
    I can call the RFC, it actually returns a value, but not one that I expect. I think the table data is not being passed at all?
    Ideas will be greatly appreciated. Thanks!
    Cheers,
    Alfonso

    HI
          try for external debugging of you RFC , and whether you are able to pass you data to the RFC ,
           public void executeZps_Fm_War_Mat_Update_Input( )
        //@@begin executeZps_Fm_War_Mat_Update_Input()
              //$$begin Service Controller(344531631)
              IWDMessageManager manager = wdComponentAPI.getMessageManager();
              try {
                   int size =
                        wdContext
                             .nodeZps_Fm_War_Mat_Prefill_Input()
                             .nodeWarOut()
                             .nodeEx_Warout()
                             .size();
                   for (int i = 0; i < size; i++) {
                        IPublicWARComp.IEx_WaroutElement srcElement =
                             wdContext
                                  .nodeZps_Fm_War_Mat_Prefill_Input()
                                  .nodeWarOut()
                                  .nodeEx_Warout()
                                  .getEx_WaroutElementAt(i);
                        IPublicWARComp.IIm_WarmatinElement trgElement =
                             wdContext.createIm_WarmatinElement(
                                  new com.kaisa.mwci.models.updatezpsmur.Zps_War());
                                              // here instead of creating a element ,  there would be some Class
    created for IIm_Warmatin  , so you can create a instance for this class and set the 
    source data element to the target .
                   ZIIm_Warmatin   target = new IIm_WarmatinElement();
                      target.set(...);
                     wdcontext.nodeIIm_Warmatin.bind(target);
       try this .          or  you can set the source data to the element created for the target .
           hopefully should work
                   wdContext
                        .currentZps_Fm_War_Mat_Update_InputElement()
                        .modelObject()
                        .execute();
                   wdContext.nodeOutWarMatIn().invalidate();
              } catch (WDDynamicRFCExecuteException e) {
                   manager.reportException(e.getMessage(), false);
              //$$end
        //@@end

  • I'm having trouble with the folder "Automatically add" function. She opens a folder "not added". My machine is a Vaio with Windows 7 home basic antivirus using Microsoft. Regards.

    I'm having trouble with the folder "Automatically add" function. She opens a folder "not added". My machine is a Vaio with Windows 7 home basic antivirus using Microsoft. Regards.

    Its a 64 bits.

  • Trouble with tables

    I'm really new at this but I've been working for days with
    little progress. I want to make a page with all my links in a
    column down the left and text and pictures one the right. I made a
    table with rows on the left for my links and one cell on the right
    into which I inserted my text. The text is the equivalent of 2
    pages of a Word document. Instead of the table expanding down to
    accomodate the text it got really wide so that I have to scroll way
    across to read it. I tried setting the width of the table before
    importing text. No diffenence. I haven't ticked off "no wrap". I
    tried importing a smaller document and that fit in better except
    the last cell on the left got really long. Please
    HEEEEELLLLP!

    I posted this is the newsgroup yesterday but it didn't come
    over to the forum, so I'll post again here.
    Hello,
    That's not all the code, I'm afraid, and it is pretty bad.
    Is that pasted from a Microsoft Word document by any chance?
    That would explain it, if it was.
    Anyway, there are a number of paragraphs where there are no
    spaces (by space
    I mean tapping the spacebar once) between words in code view.
    Instead,   was used. This is an HTML entity that
    means "non-breaking
    space".
    It looks like a space between words, but it doesn't act like
    one.
    The "non-breaking" part of it's name is the key.
    Whatever created this code used this instead of regular old
    spaces (my money
    is still on MS Word)
    You need regualr old spaces between words in the code for the
    line to wrap.
    For example, both of these sentences as seen in code view:
    <p>This sentence will wrap when it runs out of room
    becasue I am actually
    using a space between words.</p>
    <p>However, this, sentence, where, in, code, view, ", "was, used, will, not.</p>
    I cleaned things up a bit, and removed the terribly redundant
    and deprecated
    code and all the   where they weren't needed.
    This should help you get started. Just paste this into code
    view of a new
    page..
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN"
    http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8">
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    body {
    margin: 10px 0px;
    padding: 0;
    font-family:Arial, Helvetica, sans-serif;
    font-size: 12px;
    background-color: #FFFFFF;
    p {
    margin: 2px 10px;
    -->
    </style>
    </head>
    <body>
    <table width="780" border="1" align="center"
    cellpadding="0"
    cellspacing="0">
    <tr>
    <td width="250" valign="middle"><table width="280"
    border="0"
    cellpadding="0" cellspacing="0">
    <tr>
    <td align="center">abcd</td>
    </tr>
    </table></td>
    <td width="100%"><p> </p>
    <p><strong>The Kennel:</strong></p>
    <p>We are <strong>inspected
    yearly</strong> and
    <strong>certified</strong> as a
    quality<strong> Boarding Facility</strong>,
    by the <strong>Humane Societies of
    Ontario.</strong></p>
    <p> </p>
    <p><strong>For medical
    emergencies</strong> we always have a local vet
    on call:<strong> Rowland Mobile Veterinary Service is
    only a short 8 minute
    drive away.</strong></p>
    <p> </p>
    <p>Our boarding facility have <strong>large
    spacious pens</strong>
    (indoor ; for bigger dogs :<strong> 8 feet x 6
    feet</strong>, or for smaller
    dogs;<strong> 8 feet X 4 feet</strong> ). There
    is a direct outdoor access
    from each pen through a floppy door, to <strong>an
    individual outdoor
    play</strong> and<strong> exercise
    area</strong> (size for all pens are
    =8feet x 12 feet). The outdoor pens are under roof , so that
    your dog is
    safely protected from the weather elements.</p>
    <p> </p>
    <p >We also have<strong> 9 large exercise
    yards</strong><em>( 12 feet
    by 50 feet !)</em> where the dogs will go out and play
    and exercise, for
    several hours a day- weather of course permitting. exercising
    and playtime
    in the yards is<u> included</u> in your primary
    boarding package. </p>
    <p >Each Indoor pen has comfortable beds for resting.
    We use
    <strong>Kuranda beds</strong> to ensure your
    dog's best comfort.</p>
    <hr />
    <p><strong><u>Basic
    Services</u></strong></p>
    <p> The following services are
    included in our
    <strong><u>basic boarding
    package:</u></strong></p>
    <p> </p>
    <p><strong>feeding : we use 2 types
    </strong>of high end quality
    <strong>dog-kibble</strong> and one
    <strong>canned variety:</strong> </p>
    <p> </p>
    <p>1)<u> Purina Proplan</u></p>
    <p> 2)<u> Peerless</u></p>
    <p>3)For the picky eater we also offer <u>Canned
    Pal.</u></p>
    <p> </p>
    <p>You may bring your dog's own food if you do not
    wish to impose any
    feeding change for your pet. We will feed your dog
    <strong>once </strong>or
    <strong>twice </strong>a day, whatever schedule
    you prefer.</p>
    <p> </p></td>
    </tr>
    </table>
    </body>
    </html>
    Take care,
    Tim

  • How to automatically build a table with 2 alternated font colors for the lines ?

    Hi,
    I'm looking for a way to automatically build a table with alternate background color and alternate font color for the lines.
    I have this particular project (a list of companies of an industrial area) and it is updated twice a year :
    I managed to set an automated alternate background color of the lines so this works well (white/blue/white/blue...)
    But the font color does not automatically alternates... and I do not know how to set this up...
    All the companies are ordered alphabetically so when I have to insert or delete one, the whole text of the table under the modified line is messed up. Then I have unreadable white text on white background and blue text on blue background...
    Does anyone have an idea on how to automatically alternate the font color ?
    Thank you.
    Best regards,
    G.

    Hi,
    I know this [JS] code is awful but it works. If  someone wants to correct it …! 
    At the beginning, you have an Excel file. You play a little with it [doing concatenations] to get, after importing it in ID:
    Then, just run the .jsx:
    Done! 

  • Troubles with RH's transformation of FM figure titles' & table captions' formats... Same problem?

    Source agent:  FM 9.0p250, unstructured
    Transformative agent:  RH 8.0.2.208
    OS:  WinXP Pro V. 2002 SP3
    CPU:  Core2 Quad @ 2.4 GHz
    RAM:  3.25 GB
    Free Space:  12.6 GB
    File Sys.:  NTFS
    Swap: D & E (system-managed)
    Is anyone else experiencing problems with RH not correctly transforming FM figure and table titles? I can get most of my design to work, but I am having a problem with RH not following-through with some of my table title format and figure title format specifications.
    I am having problems with RH not correctly applying, or inconsistently applying, figure title and table caption attributes ("Paragraph" settings) that I specify through Project Settings | Import | Edit | Conversion Settings.
    For example (in FM Table Designer), I have a table title paragraph design, "TT.Table Title", in which I specify Title > Above Table, and specify a paragraph design (FM style) of Arial, 10pt, regular, bold, 0" indents, alignment left. It works fine direct to print or PDF; the same is true with figure titles.
    In RH (through Project Settings | Import > Edit | Conversion Settings [FrameMaker Settings] > Paragraph), I specify that the FM style is to transform through an RH style that I define (through Edit Style button > Styles > Format > Paragraph). I set the alignment, etc., as is required through RH, but when I look at the Design view and/or generate the output (say...Webhelp), RH has not correctly interpreted one or more of my specification's attributes.
    For example, in the case of my table titles, in Design view, RH has centered the title (or in RH terms, the ''Caption") above the table. Or sometimes the bold attribute is missing. In Project Manager, if I right-click and select View, the title/caption sometimes appears as specified; however, if I Generate the WebHelp (or HTML Help, or whatever), the bold formatting isn't there.
    I thought that maybe RH defaulted figure and table titles to a Caption, as that is what it calls that part in the Design view. But when I set Caption to my specs, it made no difference.
    Any thoughts?
    Thanks in advance!

    I may be off at a tangent here as this is a wild guess.
    HTML recognises Table Heading and Table Text, RH does not recognise the Table Heading selector. Maybe with your knowledge of FM's table caption and that tidbit of information, you can change something in your FM table to avoid the problem, if indeed there is a link.
    See www.grainge.org for RoboHelp and Authoring tips
    Follow me @petergrainge

  • Can you make table width editable in a template

    I am new to html and am trying to use a template to create a
    site that will eventually have 10-12 pages. All of the pages will
    have the same basic design, but some need 1 main body section and
    some need 2 (1 main and 1 smaller off to the side). After doing 4
    pages, I realized I could use a template so I wouldn't have to
    re-enter all the links in the nav bar, etc., but if I do a page
    with just one main section, I would like that section to be wider.
    The template will not allow me to adjust the table. Is there a way
    to make the table width editable/adjustable? Thanks for any help
    you can give me... I'm sure to have many more questions once this
    gets solved!

    Well, it's OK, but I'm not sure where you want to go with
    this. I'm not
    crazy about how you have used the CSS - there are things
    there that I think
    are unnecessary....
    Consider this -
    <style type="text/css">
    <!--
    body {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 80%;
    color: #000;
    background-color: #FFF;
    margin: 0 0 0 15px;
    padding: 0;
    color: #000;
    #wrapper {
    width:720px;
    div {
    border:thin solid #FFF;
    #banner {
    background-image:
    url(
    http://homepage.mac.com/nminicozzi37/PFC_Web_Test_Site/ahsban_02.gif);
    background-repeat: no-repeat;
    height: 20px;
    #main {
    font-size: 90%;
    #spacer {
    background-color: #FFF;
    height: 32px;
    #welcome {
    font-size: 125%;
    font-weight: bold;
    background-color: #FFCC00;
    height: 40px;
    padding-left: 5px;
    padding-top: 18px;
    #BlueSpacer {
    background-color: #00C;
    height: 20px;
    #welcome2 {
    font-weight: bold;
    color: #00C;
    background-color: #FC0;
    height: 45px;
    padding-left: 5px;
    padding-top: 18px;
    -->
    </style>
    </head>
    <body>
    <div id="wrapper">
    <div id="banner"></div>
    <div id="spacer">Content for id "spacer" Goes
    Here</div>
    <div id="welcome">Welcome to the Agoura High School
    Parent Faculty Club
    (AHS
    PFC) </div>
    <div id="welcome2"> Your source for all the latest PFC
    news and
    information </div>
    <div id="BlueSpacer"></div>
    <div id="main">Content for id "main" Goes
    Here</div>
    </div>
    </body>
    </html>
    Don't get into additive trouble with percent sized fonts.
    Remember, when
    you have an element with font-size:100%, that's 100% of 80%,
    and when you
    have one with font-size:60%, that's 60% of 80%.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "AH_Nancy" <[email protected]> wrote in
    message
    news:[email protected]...
    > Thank you thank you thank you for your helpful
    suggestions, Murray.
    >
    > I am definitely prepared for time in the trenches.
    Anything worth doing is
    > worth doing right. You can see what I have done so far
    >
    http://homepage.mac.com/nminicozzi37/PFC_Web_Test_Site/.
    (The top graphic
    > will
    > be replace by the correct one when I get it.) Any
    comments/suggestions
    > welcome.
    >
    > Of the ways you suggested to organize the CSS, is there
    one you would
    > recommend over the others, or is it simply a matter of
    personal
    > preference?
    >
    > Nancy
    >
    >

  • Trouble with "body" images lining up at the top

    Hi, I am having troubles with the #body style in my web page. I have inserted a table into the #body area and the the body editable region will not line up on the top with the sideBar editable region when I add text and apply my css to it. Can you look at the code and let me know what I am doing wrong? Thanks!
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Ram Restaurant &amp; Brewery</title>
    <!-- TemplateEndEditable -->
    <meta name="keywords" content="Ram Restaurant, The Ram restaurant, Ram Restaurant and brewpub, Ram Restaurant Group, Ram International" />
    <meta name="description" content="Welcome to The Ram!  Your stomach wants food.  Your tastebuds want beer.  Satisfy them both at the Ram Restaurant & Brewery." />
    <style type="text/css">
    <!--
    body {
    background-color: #333;
    margin: 0 auto;
    padding: 0px;
    margin-left: 0px;
    margin-right: 0px;
    .navbar_center {
    text-align: center;
    -->
    </style>
    <link href="/RamWebsite_NEW/cssstyles.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    color: #F00;
    margin: 0px;
    padding: 0px;
    a:link {
    color: #666;
    text-decoration: none;
    h1 {
    font-size: 36px;
    color: #000;
    h2 {
    font-size: 24px;
    color: #000;
    h3 {
    font-size: 18px;
    color: #000;
    h4 {
    font-size: 12px;
    color: #000;
    a:visited {
    text-decoration: none;
    color: #000;
    a:hover {
    text-decoration: underline;
    a:active {
    text-decoration: none;
    -->
    </style>
    <!--[if lte IE 8]>
    <style type="text/css">
    ul.MenuBarHorizontalul  li ul li ul li.MenuBarHorizontal, ul.MenuBarHorizontal li ul li.MenuBarHorizontal {
    width:100px;
    height:23px;
    </style>
    <![endif]-->
    <script src="/RamWebsite_NEW/SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    //-->
    </script>
    <link href="/RamWebsite_NEW/SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    </head>
    <body link="#000000" topmargin="0" onload="MM_preloadImages('/RamWebsite_NEW/images/Menu_rollover.jpg','/RamWebsite_NEW/imag es/EventsLink2_rollover.jpg','/RamWebsite_NEW/images/GiftCards_rollover.jpg','/RamWebsite_ NEW/images/BeerLink2_rollover.jpg')">
    <div id="wrapper">
    <div id="header">
        <table width="900" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <th width="200" height="36" rowspan="2" align="center" valign="middle" scope="col"><a href="http://www.theram.com"><img src="/RamWebsite_NEW/images/Ram-Logo-red.gif" alt="Ram Restaurant &amp; Brewery Logo" width="175" height="69" border="0" /></a></th>
            <th width="350" height="50" align="center" valign="middle" scope="col"> </th>
            <th width="200" align="center" valign="middle" scope="col"> </th>
            <th width="150" align="right" valign="middle" scope="col"><a href="http://www.facebook.com/home.php?#!/theramrestaurant?ref=ts"><img src="/RamWebsite_NEW/images/FacebookBox.gif" alt="Becoma a Facebook Fan!" width="40" height="40" border="0" /></a><a href="http://www.twitter.com/theram"><img src="/RamWebsite_NEW/images/TwitterBox.gif" alt="Follow Us on Twitter" width="40" height="40" hspace="30" border="0" /></a></th>
          </tr>
          <tr>
            <th colspan="3" align="right" scope="col"><ul id="MenuBar1" class="MenuBarHorizontal">
              <li><a class="MenuBarItemSubmenu" href="#">MENU</a>
                <ul>
                  <li><a href="#" class="MenuBarItemSubmenu">Idaho</a>
                    <ul>
                      <li><a href="/menus/idaho/boise.shtml">Boise</a></li>
                      <li><a href="/menus/idaho/meridian.shtml">Meridian</a></li>
                    </ul>
                  </li>
                  <li><a href="#" class="MenuBarItemSubmenu">Illinois</a>
                    <ul>
                      <li><a href="/menus/illinois/rosemont.shtml">Rosemont</a></li>
                      <li><a href="/menus/illinois/schaumburg.shtml">Schaumburg</a></li>
                      <li><a href="/menus/illinois/wheeling.shtml">Wheeling</a></li>
                    </ul>
                  </li>
                  <li><a href="#" class="MenuBarItemSubmenu">Indiana</a>
                    <ul>
                      <li><a href="/menus/indiana/fishers.shtml">Fishers</a></li>
                      <li><a href="/menus/indiana/indianapolis.shtml">Indianapolis</a></li>
    </ul>
                  </li>
                  <li><a href="#" class="MenuBarItemSubmenu">Oregon</a>
                    <ul>
                      <li><a href="/menus/oregon/clackamas.shtml">Clackamas</a></li>
                      <li><a href="/menus/oregon/salem.shtml">Salem</a></li>
                    </ul>
                  </li>
                  <li><a href="#" class="MenuBarItemSubmenu">Washington</a>
                    <ul>
                      <li><a href="/menus/washington/kent.shtml">Kent</a></li>
                      <li><a href="/menus/washington/lacey.shtml">Lacey</a></li>
                      <li><a href="/menus/washington/lakewood.shtml">Lakewood</a></li>
                      <li><a href="/menus/washington/puyallup.shtml">Puyallup South Hill Mall</a></li>
                      <li><a href="/menus/washington/puyallup2.shtml">Puyallup Sunrise Village</a></li>
                      <li><a href="/menus/washington/northgate.shtml">Seattle Northgate</a></li>
                      <li><a href="/menus/washington/seattle.shtml">Seattle University Village</a></li>
                      <li><a href="/menus/washington/tacoma.shtml">Tacoma</a></li>
                    </ul>
                  </li>
                </ul>
              </li>
              <li><a href="#" class="MenuBarItemSubmenu">LOCATIONS</a>
                <ul>
                  <li><a href="#" class="MenuBarItemSubmenu">Idaho</a>
                    <ul>
                      <li><a href="/idaho/boiseNew.html">Boise</a></li>
                      <li><a href="/idaho/meridianNew.html">Meridian</a></li>
                    </ul>
                  </li>
                  <li><a href="#" class="MenuBarItemSubmenu">Illinois</a>
                    <ul>
                      <li><a href="/illinois/rosemontNew.html">Rosemont</a></li>
                      <li><a href="/illinois/schaumburgNew.html">Schaumburg</a></li>
                      <li><a href="/illinois/wheelingNew.html">Wheeling</a></li>
                    </ul>
                  </li>
                  <li><a href="#" class="MenuBarItemSubmenu">Indiana</a>
                    <ul>
                      <li><a href="/indiana/fishersNew.html">Fishers</a></li>
                      <li><a href="/indiana/indianapolisNew.html">Indianapolis</a></li>
                    </ul>
                  </li>
                  <li><a href="#" class="MenuBarItemSubmenu">Oregon</a>
                    <ul>
                      <li><a href="/oregon/clackamasNew.html">Clackamas</a></li>
                      <li><a href="/oregon/salemNew.html">Salem</a></li>
                    </ul>
                  </li>
                  <li><a href="#" class="MenuBarItemSubmenu">Washington</a>
                    <ul>
                      <li><a href="/washington/kentNew.html">Kent</a></li>
                      <li><a href="/washington/laceyNew.html">Lacey</a></li>
                      <li><a href="/washington/lakewoodNew.html">Lakewood</a></li>
                      <li><a href="/washington/puyallup-southHill-NEW.html">Puyallup South Hill Mall</a></li>
                      <li><a href="/washington/puyallup-Sunrise-New.html">Puyallup Sunrise Village</a></li>
                      <li><a href="/washington/northgateNew.html">Seattle Northgate</a></li>
                      <li><a href="/washington/seattleNew.html">Seattle University Village</a></li>
                      <li><a href="/washington/tacomaNew.html">Tacoma</a></li>
                    </ul>
                  </li>
                </ul>
              </li>
              <li><a class="MenuBarItemSubmenu" href="#">PROMOS</a>
                <ul>
                  <li><a href="/drink_specials.shtml">Drink Promos</a>              </li>
                  <li><a href="/food_specials.shtml">Food Promos</a></li>
    </ul>
              </li>
              <li><a href="/news.shtml">RAM NEWS</a></li>
              <li><a href="/about.shtml">ABOUT US</a></li>
              <li><a href="#" class="MenuBarItemSubmenu">CONTACT US</a>
                <ul>
                  <li><a href="/contact.shtml">General Info</a></li>
                  <li><a href="/employment.shtml">Careers</a></li>
                  <li><a href="/comments.shtml">Comments</a></li>
                </ul>
              </li>
              <li><a href="/banquets.shtml" class="MenuBarItemSubmenu">BANQUETS</a>
                <ul>
                  <li><a href="/banquets.shtml">Banquets</a></li>
                  <li><a href="/banquets-catering.shtml">Off-Site Catering</a></li>
                </ul>
              </li>
            </ul></th>
          </tr>
          <tr>
            <th colspan="4" align="center" valign="middle" scope="col"><img src="/RamWebsite_NEW/images/redbar.gif" width="900" height="11" /></th>
          </tr>
        </table>
    </div>
    <div id="body">
      <table width="900" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <th height="300" valign="top" scope="col"><table width="900" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <th width="225" align="center" valign="top" bgcolor="#000000" scope="col"><!-- TemplateBeginEditable name="sideBar" -->adfadsfds<!-- TemplateEndEditable --></th>
              <th width="675" align="left" valign="top" bgcolor="#FFFFFF" scope="col"><!-- TemplateBeginEditable name="body" -->
                <p><img src="/images/aboutus2.jpg" width="675" height="300" /></p>
                <p class="foodNameDesc">adfadslkj</p>
              <!-- TemplateEndEditable --></th>
            </tr>
          </table></th>
        </tr>
      </table>
    </div>
    <div id="bottomMenuSubPg">
      <table width="900" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <th width="200" align="center" scope="col"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Menu','','/RamWebsite_NEW/images/Menu_rollover.jpg',1)"><img src="/RamWebsite_NEW/images/Menu.jpg" alt="Menu" name="Menu" width="212" height="125" hspace="6" border="0" id="Menu" /></a></th>
          <th width="200" align="center" scope="col"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Big Horn Beer','','/RamWebsite_NEW/images/BeerLink2_rollover.jpg',1)"><img src="/RamWebsite_NEW/images/BeerLink2.jpg" alt="Big Horn Beer" name="Big Horn Beer" width="212" height="125" hspace="6" border="0" id="Big Horn Beer" /></a></th>
          <th width="200" align="center" scope="col"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Events','','/RamWebsite_NEW/images/EventsLink2_rollover.jpg',1 )"><img src="/RamWebsite_NEW/images/EventsLink2.jpg" alt="Events at the Ram" name="Events" width="212" height="125" hspace="6" border="0" id="Events" /></a></th>
          <th width="200" align="center" scope="col"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Gift Cards','','/RamWebsite_NEW/images/GiftCards_rollover.jpg',1)"><img src="/RamWebsite_NEW/images/GiftCards.jpg" alt="Gift Cards" name="Gift Cards" width="212" height="125" hspace="6" border="0" id="Gift Cards" /></a></th>
        </tr>
      </table>
    </div>
    <div id="bottommenu2"></div>
    <map name="Map" id="Map">
      <area shape="poly" coords="16,103" href="#" />
      <area shape="poly" coords="49,71,102,58,158,73,191,113,180,141,151,161,109,169,65,162,31,141,18,112" href="http://theram.fbmta.com/members/UpdateProfile.aspx?Action=Subscribe&amp;InputSource=W" target="_blank" />
    </map>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"/RamWebsite_NEW/SpryAssets/SpryMenuBarDownHover.gif", imgRight:"/RamWebsite_NEW/SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </div>
    </body>
    </html>

    You have your image in the 'body editable region' wrapped in <p></p> tags (paragraph tags). <p> tags have padding and margin set on them by default.
    <p><img src="/images/aboutus2.jpg" width="675" height="300" /></p>
    You can either just remove the <p></p> tags or you can zero out the padding and margin:
    p {
    padding: 0;
    margin: 0;
    Unfortuanately the above will target every paragraph on your page which might not be desirable so I would just remove the <p> tags as it is not necessary to wrap an image in them.
    If you do want to keep the <p> tags then use some inline css to specifically remove the padding and margin on that particular one:
    <p style="padding: 0; margin: 0;"><img src="/images/aboutus2.jpg" width="675" height="300" /></p>

Maybe you are looking for