A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Merged cells



 
 
Thread Tools Display Modes
  #1  
Old August 29th, 2006, 09:56 AM posted to microsoft.public.word.tables
Jorge
external usenet poster
 
Posts: 91
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  
Old August 29th, 2006, 10:08 AM posted to microsoft.public.word.tables
Jezebel
external usenet poster
 
Posts: 1,369
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  
Old August 29th, 2006, 10:50 AM posted to microsoft.public.word.tables
Jorge
external usenet poster
 
Posts: 91
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  
Old August 29th, 2006, 10:52 AM posted to microsoft.public.word.tables
Jorge
external usenet poster
 
Posts: 91
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  
Old August 29th, 2006, 11:35 AM posted to microsoft.public.word.tables
Jezebel
external usenet poster
 
Posts: 1,369
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  
Old August 29th, 2006, 01:04 PM posted to microsoft.public.word.tables
Jorge
external usenet poster
 
Posts: 91
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  
Old August 30th, 2006, 12:20 AM posted to microsoft.public.word.tables
Jezebel
external usenet poster
 
Posts: 1,369
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








 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.