Pages: 1
Print
Author Topic: How to change table width?  (Read 7719 times)
linjinwei
Member

Posts: 65


« on: November 24, 2008, 08:09:40 PM »

First an introduction.
Hi, I am new here and also new to XMetal. I will very likely have lots and lots of questions. So please bare with me. I need these solved for my project.

My question: How do you change the table width? No matter what width I set in "table properties", in pdf will always show 100%(full width of file). I checked the "tables-attr.xsl", and I believe this is where you change the coding for table.

Code:
line 54

     <xsl:attribute-set name="table.tgroup">
       <!--It is a table-->
     <xsl:attribute name="table-layout">auto</xsl:attribute>
      <xsl:attribute name="width">100%</xsl:attribute>
        <xsl:attribute name="space-before.optimum">5pt</xsl:attribute>
        <xsl:attribute name="space-after.optimum">5pt</xsl:attribute>
    </xsl:attribute-set>

What do I need to change? I changed "table-layout" from "fixed" to "auto", but still didnt work...



By the way, if I have more questions, do I post in new thread or edit this one?

« Last Edit: November 24, 2008, 08:56:35 PM by linjinwei » Logged
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #1 on: November 25, 2008, 12:35:41 PM »

Welcome to XMetaL, linjinwei. Please create a new thread for each question. Don't worry, we'r all new here :)
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
linjinwei
Member

Posts: 65


« Reply #2 on: November 25, 2008, 06:40:53 PM »

Thanks for the warm welcome.

But im afraid you didnt answer my first question...
Logged
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #3 on: November 26, 2008, 06:44:21 PM »

I didn't answer because I don't know XSL. Can anyone else answer this question?
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
mag3737
XMetaL Evangelist
Administrator
Member

Posts: 100


I even use XMetaL to write my business letters.


« Reply #4 on: November 26, 2008, 07:16:58 PM »

I'm afraid I don't immediately know the answer to your "real" question either.  But it looks to me like you are using DITA.  (I recognize that filename as being from the DITA OT.)  So...if no one comes up with an answer here quickly, you might also try asking the question on the dita-users email list (http://tech.groups.yahoo.com/group/dita-users/)
Logged

Tom Magliery
JustSystems Canada, Inc.
linjinwei
Member

Posts: 65


« Reply #5 on: November 26, 2008, 11:35:42 PM »

What's DITA?

OK my real question is simply how to change the table width?
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 1548



WWW
« Reply #6 on: November 27, 2008, 12:18:22 PM »

To answer this question easily we need to know the following:

Which DTD or Schema are you working with? (this is why people are asking about "DITA")

Which table model does the DTD use? XMetaL supports HTML, CALS, and "semantic" tables.

Are you asking about modifying the width during editing or in output?

The first two have official specs (HTML at W3C and CALS at OASIS) and XMetaL Author allows you to modify the width for both of these very easily during editing through the user interface, either by dragging borders or using the Table Properties dialog, provided your DTD or Schema defines these tables using the proper attributes to support this.

Semantic tables are any group of elements you have customized (usually using XMetaL Developer) to render as a table using CSS settings. The width of semantic tables is automatically determined by the content it contains, but will not render larger than the width of the current editing width of the document containing it.

When producing output the width of tables is defined directly as a result of the process used to generate that output in combination with the XML being passed to that process. The transformation process might use XSLT, XSLT + XSL-FO, or some other method. So, knowing the table type is important, knowing which tool you are using to generate output is important, as well as the type of output you are producing.

If you are working with DITA documents then we might assume you are using the DITA Open Toolkit that is integrated with XMetaL Author Enterprise. In that case we still need to know which type of output you are attempting to produce.
« Last Edit: November 27, 2008, 12:27:22 PM by Derek Read » Logged
linjinwei
Member

Posts: 65


« Reply #7 on: November 27, 2008, 06:41:23 PM »

Im not very sure either. Perharps it is easier to describe with screenshots.

1)First I created a table, and set the width to 5cm


2)Then I run the output in pdf


3)As you can see, the result of the table in pdf is not 5cm, but the full width


What I'm trying to say is, no matter what value I set for the Table width, it will always be the same as image 3.
I'm not sure whether this is HTML, CALS, or "semantic" tables.
Logged
linjinwei
Member

Posts: 65


« Reply #8 on: November 30, 2008, 06:45:56 PM »

Nobody?
Logged
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #9 on: December 01, 2008, 01:38:21 PM »

Hi Linjinwei,

I'll look into this. It's very hard to see what's going on in your screenshots because they are so small. Can you post bigger ones?

I assume you're using the Table menu to insert the table? When the dialog comes up asking for a "Table Type", are you choosing "Normal table" or something else?
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #10 on: December 01, 2008, 07:21:48 PM »

I did some testing and this seems to be a bug in the open-source DITA Open Toolkit that XMetaL invokes to publish DITA content. I've logged it here: https://sourceforge.net/tracker2/?func=detail&aid=2374525&group_id=132728&atid=725074

I'm surprised that I've never seen anyone else report this bug before. In theory, bugs in the Open Toolkit can be fixed by anyone (and anyone can then contribute their fix back into the Open Toolkit). Unfortunately I don't know enough XSL to specify how exactly to fix it. Maybe others can help here.
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
linjinwei
Member

Posts: 65


« Reply #11 on: December 01, 2008, 07:29:13 PM »

The table type is Normal.
I'm still not sure whether this is HTML, CALS, or "semantic" tables.
I'll repost everything:


1)First I created a table, and set the width to 5cm


2)Then I run the output in pdf


3)As you can see, the result of the table in pdf is not 5cm, but the full width



Edit: So you are saying that the only solution is to wait for the next release?

Logged
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #12 on: December 01, 2008, 07:41:46 PM »

No, I'm saying that that this bug can be fixed by anyone who has the necessary technical skills, including other XMetaL users, or other DITA Open Toolkit users who do not use XMetaL. Most likely there is a file in the Open Toolkit that needs to be edited to have some logic added to it.
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #13 on: December 01, 2008, 07:45:52 PM »

By the way, the screenshots are coming through very clearly now and it really helps. Thanks for reposting them.
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
Pages: 1
Print
Jump to: