2

I'm using REXX on a PC to convert a tab delimited table to HTML. The REXX code identifies rows, cells and columns that vary in location from one table to the next but which require rotation, bold highlighting, and either light blue, light gray or no filler. All of this is working, but the size of the tables could be reduced if there is a way to indicate a count of duplicate <td></td> entries in a given row.

The output has predefined XML code which defines an Excel sheet and is followed by the table. The table is two-dimensional. By this I mean the top row lists attributes and the left column lists entities which may have some, but not necessarily all, of the attributes. At the intersection of an attribute column and entity row the cell may contain one of several values, including a space. Some rows may be 50 or more cells long and contain a value only in the 48th column. In this example, when I build that row, I have 50 combinations of <td></td>. In the case of empty columns from 2 through 47 I need to repeat that empty <td></td> 46 times to assure the cell with a value is shown under the correct attribute. Some tables may have 10,000 rows.

Does HTML have a repeat counter? Perhaps something like this:
<r c=46><td></td></r>
where <r indicates a need to repeat and must contain "c=" for the repeat count of <td></td> and of course a closing </r>.

A repeat counter would reduce load and transmit time as well as the size of the HTML file.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Don Hoben
  • 21
  • 4
  • I have a follow up question. When I use colspan those cells lose their border when the file is opened with Excel. I've had this problem with other cells. I've tried to center the content in cells with a single character with the attribute "text-align:center". In those cases the border lines are lost also. Is there a solution? – Don Hoben Feb 06 '18 at 12:52

1 Answers1

4

There is no "repeat" counter, however, you could use "colspan" instead of adding 46 <td></td>.

Example:

<tr><td colspan="46"><td></tr>
hokielife
  • 166
  • 3
  • Thanks Brian.I directly edited the file, changed a series of empty table detail cells with the colspan attribute and it worked. – Don Hoben Feb 02 '18 at 17:22