DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Html

  1. #1
    Join Date
    Oct 2004

    Question Html

    Hi everyone,

    I am trying to add html tables to a html document and the html table appears but here is the problem in that only certain attributes of the table is being adhered to and the rest ignored. This is what i am doing

    String table = "<table width=\"80%\" height=\"80%\" cellspacing=\"200\" 
                       cellpadding=\"10\" border=\"20\" bordercolor=\"#ff0033\" 
    Element ele = doc.getParagraphElement(Pane1.getCaretPosition());
    doc.insertAfterEnd(ele, table);
    catch(Exception e)
    Please note that Pane1 is an instance of the JTextPane class and doc is an instance of the HTMLDocument class which uses the default HTMLEditorKit class.

    The table appears in the document but only cell padding, background color and table width options if varied produces the appropriate changes to the table that is being inserted.

    The rest of the options such as borderwidth, bordercolor cell spacing and table height don't have any differences even when they are varied. They always remain the same.

    Basically i need to know if i am inserting the html table correctly into the HTMLDocument or is there something that i need to do which i am not doing in the above code.

    I am using the java sdk 1.4.2

    Any help is greatly appreciated

    Thank You

    Yours Sincerely

    Richard West
    Last edited by freesoft_2000; 07-07-2005 at 07:05 PM.

  2. #2
    Join Date
    Dec 2004
    San Bernardino County, California
    Your HTML looks ok to me ...

    Are you seeing some browser specific implementations?

    The height attribute only has an effect if needed to contain all of the content of the cells. Have you put actual content in your table and played with the attributes? Maybe the other attributes which don't look like they are working will work when you have content in the cells ...

  3. #3
    Join Date
    Oct 2004
    Hi everyone,

    I inserted the html table and then tried to add attributes to the data in the cells but i still got the same results and really do not know why this is so and am open to any suggestions

    Richard West

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.