#1   Report Post  
Posted to microsoft.public.word.tables
Jorge Jorge is offline
external usenet poster
 
Posts: 10
Default Merged cells

Hi everybody,

I'm developing my own macro to convert a Microsoft Word document in an HTML
document.
Tables with merged cells are a major problem, since I can detect the
existence of merged cells but I cannot identify them. Anyone can give me a
tip?

Thanks

Jorge
  #2   Report Post  
Posted to microsoft.public.word.tables
Jezebel Jezebel is offline
external usenet poster
 
Posts: 1,384
Default Merged cells

Depends what 'identify them' means for you. You can get some information by
comparing the .Row, .RowIndex, .Column and .ColumnIndex properties.

But the problem is ultimately indeterminate, because there's no underlying
'correct' table from which the merging causing deviations. The table model
is really a somewhat fuzzy beast.

You can create an HTML table from a Word table without reference to cell
merging: just count the number of cells in each row and column, and go from
there.


"Jorge" wrote in message
...
Hi everybody,

I'm developing my own macro to convert a Microsoft Word document in an
HTML
document.
Tables with merged cells are a major problem, since I can detect the
existence of merged cells but I cannot identify them. Anyone can give me a
tip?

Thanks

Jorge



  #3   Report Post  
Posted to microsoft.public.word.tables
Jorge Jorge is offline
external usenet poster
 
Posts: 10
Default Merged cells

I'll give you a practical example to clarify my question a bit mo

I get the same properties for a 3x3 table in which Cell(1,3) and Cell(2,3)
are merged and a 3x3 table in which Cell(2,2) and Cell(2,3) are merged.

Certainly, these tables are not the same, so I cannot simply count the
number of rows and columns because I'd end up with the same table in both
cases.

"Jezebel" wrote:

Depends what 'identify them' means for you. You can get some information by
comparing the .Row, .RowIndex, .Column and .ColumnIndex properties.

But the problem is ultimately indeterminate, because there's no underlying
'correct' table from which the merging causing deviations. The table model
is really a somewhat fuzzy beast.

You can create an HTML table from a Word table without reference to cell
merging: just count the number of cells in each row and column, and go from
there.


"Jorge" wrote in message
...
Hi everybody,

I'm developing my own macro to convert a Microsoft Word document in an
HTML
document.
Tables with merged cells are a major problem, since I can detect the
existence of merged cells but I cannot identify them. Anyone can give me a
tip?

Thanks

Jorge




  #4   Report Post  
Posted to microsoft.public.word.tables
Jorge Jorge is offline
external usenet poster
 
Posts: 10
Default Merged cells

I'll give you a practical example to clarify my question a bit mo

I get the same properties for a 3x3 table in which Cell(1,3) and Cell(2,3)
are merged and a 3x3 table in which Cell(2,2) and Cell(2,3) are merged.

Certainly, these tables are not the same, so I cannot simply count the
number of rows and columns because I'd end up with the same table in both
cases.

Thanks


"Jezebel" wrote:

Depends what 'identify them' means for you. You can get some information by
comparing the .Row, .RowIndex, .Column and .ColumnIndex properties.

But the problem is ultimately indeterminate, because there's no underlying
'correct' table from which the merging causing deviations. The table model
is really a somewhat fuzzy beast.

You can create an HTML table from a Word table without reference to cell
merging: just count the number of cells in each row and column, and go from
there.


"Jorge" wrote in message
...
Hi everybody,

I'm developing my own macro to convert a Microsoft Word document in an
HTML
document.
Tables with merged cells are a major problem, since I can detect the
existence of merged cells but I cannot identify them. Anyone can give me a
tip?

Thanks

Jorge




  #5   Report Post  
Posted to microsoft.public.word.tables
Jezebel Jezebel is offline
external usenet poster
 
Posts: 1,384
Default Merged cells

That's exactly the point: you end up with the same table either way. And in
HTML, it *IS* the same table either way. What are you actually trying to do?



"Jorge" wrote in message
...
I'll give you a practical example to clarify my question a bit mo

I get the same properties for a 3x3 table in which Cell(1,3) and Cell(2,3)
are merged and a 3x3 table in which Cell(2,2) and Cell(2,3) are merged.

Certainly, these tables are not the same, so I cannot simply count the
number of rows and columns because I'd end up with the same table in both
cases.

"Jezebel" wrote:

Depends what 'identify them' means for you. You can get some information
by
comparing the .Row, .RowIndex, .Column and .ColumnIndex properties.

But the problem is ultimately indeterminate, because there's no
underlying
'correct' table from which the merging causing deviations. The table
model
is really a somewhat fuzzy beast.

You can create an HTML table from a Word table without reference to cell
merging: just count the number of cells in each row and column, and go
from
there.


"Jorge" wrote in message
...
Hi everybody,

I'm developing my own macro to convert a Microsoft Word document in an
HTML
document.
Tables with merged cells are a major problem, since I can detect the
existence of merged cells but I cannot identify them. Anyone can give
me a
tip?

Thanks

Jorge








  #6   Report Post  
Posted to microsoft.public.word.tables
Jorge Jorge is offline
external usenet poster
 
Posts: 10
Default Merged cells

First of all, thanks for your patience. I must be explaining myself very badly.
The output I want to get for a 3x3 table in which Cell(1,3) and Cell(2,3)
are merged is the following:

table border="1"
tr
tdCell 1,1/td
tdCell 1,2/td
td rowspan="2"Cell 1,3/td
/tr
tr
tdCell 2,1/td
tdCell 2,2/td
/tr
tr
tdCell 3,1/td
tdCell 3,2/td
tdCell 3,3/td
/tr
/table

The output I want to get for a 3x3 table in which Cell(2,2) and Cell(2,3)
are merged is the following:

table border="1"
tr
tdCell 1,1/td
tdCell 1,2/td
tdCell 1,3/td
/tr
tr
tdCell 2,1/td
td colspan="2"Cell 2,2/td
/tr
tr
tdCell 3,1/td
tdCell 3,2/td
tdCell 3,3/td
/tr
/table

I'm sorry to insist, these tables have exactly the same number of cells,
rows and columns, but they are not the same because in the first case,
Cell(1,3) occupies two rows and in the second case Cell(2,2) occupies two
columns.





"Jezebel" wrote:

That's exactly the point: you end up with the same table either way. And in
HTML, it *IS* the same table either way. What are you actually trying to do?



"Jorge" wrote in message
...
I'll give you a practical example to clarify my question a bit mo

I get the same properties for a 3x3 table in which Cell(1,3) and Cell(2,3)
are merged and a 3x3 table in which Cell(2,2) and Cell(2,3) are merged.

Certainly, these tables are not the same, so I cannot simply count the
number of rows and columns because I'd end up with the same table in both
cases.

"Jezebel" wrote:

Depends what 'identify them' means for you. You can get some information
by
comparing the .Row, .RowIndex, .Column and .ColumnIndex properties.

But the problem is ultimately indeterminate, because there's no
underlying
'correct' table from which the merging causing deviations. The table
model
is really a somewhat fuzzy beast.

You can create an HTML table from a Word table without reference to cell
merging: just count the number of cells in each row and column, and go
from
there.


"Jorge" wrote in message
...
Hi everybody,

I'm developing my own macro to convert a Microsoft Word document in an
HTML
document.
Tables with merged cells are a major problem, since I can detect the
existence of merged cells but I cannot identify them. Anyone can give
me a
tip?

Thanks

Jorge






  #7   Report Post  
Posted to microsoft.public.word.tables
Jezebel Jezebel is offline
external usenet poster
 
Posts: 1,384
Default Merged cells

In both cases you need to maintain an internal model of the 'theoretical'
model of the table, and populate it by examining the cells of the table
individually. This is actually really hard to do: the Word programmers have
never really conquered the problem. The example you give is not too hard,
but consider: take a table with five columns and four rows. Now merge cells
1,1 and 1,2; 2,2 and 2,3; 3,3 and 3,4; 4,4 and 4,5. Now re-align the column
boundaries: do you end up with 4 x 4 table, or a 4 x 5 table with a merged
cell in each row?

This is without even starting on the further complications of split and
deleted cells.

However, for your immediate purposes: you can do the first table by looking
at each cell's .ColumnIndex and .RowIndex properties. You'll see that row 2
has cells in columns 1 and 2 only; therefore its third column must be merged
with the row above. This requires the assumption that the table has not had
cells deleted. (Consider a 3 x 3 table with cell 2,3 deleted from it -- if
that's all that's happened you could tell the difference because .Uniform
would still be true in the latter case.)




"Jorge" wrote in message
...
First of all, thanks for your patience. I must be explaining myself very
badly.
The output I want to get for a 3x3 table in which Cell(1,3) and Cell(2,3)
are merged is the following:

table border="1"
tr
tdCell 1,1/td
tdCell 1,2/td
td rowspan="2"Cell 1,3/td
/tr
tr
tdCell 2,1/td
tdCell 2,2/td
/tr
tr
tdCell 3,1/td
tdCell 3,2/td
tdCell 3,3/td
/tr
/table

The output I want to get for a 3x3 table in which Cell(2,2) and Cell(2,3)
are merged is the following:

table border="1"
tr
tdCell 1,1/td
tdCell 1,2/td
tdCell 1,3/td
/tr
tr
tdCell 2,1/td
td colspan="2"Cell 2,2/td
/tr
tr
tdCell 3,1/td
tdCell 3,2/td
tdCell 3,3/td
/tr
/table

I'm sorry to insist, these tables have exactly the same number of cells,
rows and columns, but they are not the same because in the first case,
Cell(1,3) occupies two rows and in the second case Cell(2,2) occupies two
columns.





"Jezebel" wrote:

That's exactly the point: you end up with the same table either way. And
in
HTML, it *IS* the same table either way. What are you actually trying to
do?



"Jorge" wrote in message
...
I'll give you a practical example to clarify my question a bit mo

I get the same properties for a 3x3 table in which Cell(1,3) and
Cell(2,3)
are merged and a 3x3 table in which Cell(2,2) and Cell(2,3) are merged.

Certainly, these tables are not the same, so I cannot simply count the
number of rows and columns because I'd end up with the same table in
both
cases.

"Jezebel" wrote:

Depends what 'identify them' means for you. You can get some
information
by
comparing the .Row, .RowIndex, .Column and .ColumnIndex properties.

But the problem is ultimately indeterminate, because there's no
underlying
'correct' table from which the merging causing deviations. The table
model
is really a somewhat fuzzy beast.

You can create an HTML table from a Word table without reference to
cell
merging: just count the number of cells in each row and column, and go
from
there.


"Jorge" wrote in message
...
Hi everybody,

I'm developing my own macro to convert a Microsoft Word document in
an
HTML
document.
Tables with merged cells are a major problem, since I can detect the
existence of merged cells but I cannot identify them. Anyone can
give
me a
tip?

Thanks

Jorge








Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to detect merged table cells? Tony Logan Tables 3 August 18th 06 11:14 PM
Cell border confusion after cells are merged Hack Tables 5 February 22nd 06 01:30 PM
Insert Column when merged cells exist Brian Kaplan Tables 2 December 5th 05 05:13 PM
Sum Above table with merged cells in Word 2003 Lynn Taylor Microsoft Word Help 2 March 25th 05 02:37 PM
Adding columns in table with merged cells Dee Tables 1 March 19th 05 01:18 PM


All times are GMT +1. The time now is 06:50 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"