How can I align nodes horizontally when rankdir=LR in graphviz - graphviz

My code is
digraph{
rankdir=LR;
ratio=auto
node[shape=rectangle];
i0[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="2">
I<sub>0</sub>:
</TD>
<TD align="left">
S'→.bexpr<BR ALIGN="LEFT"/>
</TD>
</TR>
<TR>
<TD align="left" bgcolor="#aaaaaa">
bexpr→.bexpr or bterm <BR ALIGN="LEFT"/>
bexpr→.bterm <BR ALIGN="LEFT"/>
bterm→ .bterm and bfactor <BR ALIGN="LEFT"/>
bterm→.bfactor <BR ALIGN="LEFT"/>
bfactor→.not bfactor <BR ALIGN="LEFT"/>
bfactor→.(bexpr) <BR ALIGN="LEFT"/>
bfactor→.true <BR ALIGN="LEFT"/>
bfactor→.false <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i1[label=<
<TABLE border="0">
<TR>
<TD valign="top">
I<sub>1</sub>:
</TD>
<TD align="left">
S'→bexpr. <BR ALIGN="LEFT"/>
bexpr→bexpr .or bterm <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i2[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="1">
I<sub>2</sub>:
</TD>
<TD align="left">
bexpr→bterm. <BR ALIGN="LEFT"/>
bterm→bterm .and bfactor <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i3[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="1">
I<sub>3</sub>:
</TD>
<TD align="left">
bterm→bfactor.<BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i4[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="2">
I<sub>4</sub>:
</TD>
<TD align="left">
bfactor→not .bfactor <BR ALIGN="LEFT"/>
</TD>
</TR>
<TR>
<TD align="left" bgcolor="#aaaaaa">
bfactor→.not bfactor <BR ALIGN="LEFT"/>
bfactor→.(bexpr) <BR ALIGN="LEFT"/>
bfactor→.true <BR ALIGN="LEFT"/>
bfactor→.false <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i5[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="2">
I<sub>5</sub>:
</TD>
<TD align="left">
bfactor→(.bexpr) <BR ALIGN="LEFT"/>
</TD>
</TR>
<TR>
<TD align="left" bgcolor="#aaaaaa">
bexpr→.bexpr or bterm <BR ALIGN="LEFT"/>
bexpr→.bterm <BR ALIGN="LEFT"/>
bterm→.bterm and bfactor <BR ALIGN="LEFT"/>
bterm→.bfactor <BR ALIGN="LEFT"/>
bfactor→.not bfactor <BR ALIGN="LEFT"/>
bfactor→.(bexpr) <BR ALIGN="LEFT"/>
bfactor→.true <BR ALIGN="LEFT"/>
bfactor→.false <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i6[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="1">
I<sub>6</sub>:
</TD>
<TD align="left">
bfactor→true.<BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i7[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="1">
I<sub>7</sub>:
</TD>
<TD align="left">
bfactor→false. <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i8[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="2">
I<sub>8</sub>:
</TD>
<TD align="left">
bexpr→bexpr or .bterm <BR ALIGN="LEFT"/>
</TD>
</TR>
<TR>
<TD align="left" bgcolor="#aaaaaa">
bterm→ .bterm and bfactor <BR ALIGN="LEFT"/>
bterm→.bfactor <BR ALIGN="LEFT"/>
bfactor→.not bfactor <BR ALIGN="LEFT"/>
bfactor→.(bexpr) <BR ALIGN="LEFT"/>
bfactor→.true <BR ALIGN="LEFT"/>
bfactor→.false <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i9[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="2">
I<sub>9</sub>:
</TD>
<TD align="left">
bterm→ bterm and .bfactor <BR ALIGN="LEFT"/>
</TD>
</TR>
<TR>
<TD align="left" bgcolor="#aaaaaa">
bfactor→.not bfactor <BR ALIGN="LEFT"/>
bfactor→.(bexpr) <BR ALIGN="LEFT"/>
bfactor→.true <BR ALIGN="LEFT"/>
bfactor→.false <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i10[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="1">
I<sub>10</sub>:
</TD>
<TD align="left">
bfactor→not bfactor. <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i11[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="1">
I<sub>11</sub>:
</TD>
<TD align="left">
bfactor→(bexpr.) <BR ALIGN="LEFT"/>
bexpr→bexpr .or bterm <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i12[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="1">
I<sub>12</sub>:
</TD>
<TD align="left">
bexpr→bexpr or bterm. <BR ALIGN="LEFT"/>
bterm→ bterm .and bfactor <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i13[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="1">
I<sub>13</sub>:
</TD>
<TD align="left">
bterm→ bterm and bfactor. <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
i14[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="1">
I<sub>14</sub>:
</TD>
<TD align="left">
bfactor→(bexpr). <BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];
node[width=0.15,shape=none,fixedsize=false];
i2_1[label=<I<sub>2</sub>>];
i3_1[label=<I<sub>3</sub>>];
i3_2[label=<I<sub>3</sub>>];
i4_2[label=<I<sub>4</sub>>];
i4_3[label=<I<sub>4</sub>>];
i4_3[label=<I<sub>4</sub>>];
i5_1[label=<I<sub>5</sub>>];
i5_3[label=<I<sub>5</sub>>];
i5_4[label=<I<sub>5</sub>>];
i6_1[label=<I<sub>6</sub>>];
i6_2[label=<I<sub>6</sub>>];
i6_3[label=<I<sub>6</sub>>];
i6_4[label=<I<sub>6</sub>>];
i7_1[label=<I<sub>7</sub>>];
i7_2[label=<I<sub>7</sub>>];
i7_3[label=<I<sub>7</sub>>];
i7_4[label=<I<sub>7</sub>>];
i8_1[label=<I<sub>8</sub>>];
i9_1[label=<I<sub>9</sub>>];
i0 -> i1 [label ="bexpr"];
i0 -> i2 [label = "bterm"];
i0 -> i3 [label = "bfactor"];
i0 -> i4 [label = "not"];
i0 -> i5 [label = "("];
i0 -> i6 [label = "true"];
i0 -> i7 [label = "false"];
i1 -> i8 [label = "or"];
i2 -> i9 [label = "and"];
i4 -> i10 [label = "bfactor"];
i4 -> i4 [label = "not",weight=1];
i4 -> i5_1 [label = "("];
i4 -> i6_1 [label = "true"];
i4 -> i7_1 [label = "false"];
i5 -> i11 [label = "bexpr"];
i5 -> i2_1 [label ="bterm"];
i5 -> i3_1 [label = "bfactor"];
i5 -> i4_2 [label = "not"];
i5:sw -> i5:_ [label = "("];
i5 -> i6_2 [label = "true"];
i5 -> i7_2 [label = "false"];
i8 -> i12 [label = "bterm"];
i8 -> i3_2 [label = "bfactor"];
i8 -> i4_3 [label = "not"];
i8 -> i5_3 [label = "("];
i8 -> i6_3 [label = "true"];
i8 -> i7_3 [label = "false"];
i9 -> i13 [label = "bfactor"];
i9 -> i4_4 [label = "not"];
i9 -> i5_4 [label = "("];
i9 -> i6_4 [label = "true"];
i9 -> i7_4 [label = "false"];
i11 -> i14 [label = ")"];
i11 -> i8_1 [label = "or"];
i12 -> i9_1[label = "and"];
{rank = same;i0,i5};
}
And it generates this:
First, I want the I0, I1, I8, I12 to align horizontally. Does it have to use subgraph to wrap up some nodes? If it does, how? I have tried wrap I0, I1 nodes and the edge from I0 to I1 with a subgraph for a test. But that didn't make much change.
Secondly, can the self-loop in I5 look more elegant like the self-loop in I4 but not at the top of the node. I only find portpos option. If the node is a circle, the portpos option is enough. But it looks strange with rectangle.

Since no one answered, I asked the same question in the graphviz mailinglist and get the answer.
For the first question, add weight=100 to the edges. Here is what weight means from the manual:
Weight of edge. In dot, the heavier the weight, the shorter, straighter and more vertical the edge is.
For the second question, there is not perfect solution. An alteritive is leaving the control of edge to dot, but changing the position of label by option labelangle and labeldistance
i5 -> i5 [labelangle=20 labeldistance=2.5 taillabel = "("];
Thanks, Emden R. Gansner!

I can confirm that setting weight=100 worked to center the node in the cluster. I was searching for the settings in graphviz in order to center the units of the neural network I try to visualize. None of the attrs in the http://www.graphviz.org/doc/info/attrs.html looked obvious enough, but weight=100 on the edges certainly worked like a charm.

Related

TDs mixed into one big column in an HTML Email

I am using an html table in an html based email. The table displays correctly if the number of columns in the email are less than 68. But if the number of columns are more than that then the remaining columns are mixed into 68th column in an outlook email.
Any idea on what I might be doing wrong?
The HTML code is:
<table border=1>
<thead>
<tr>
<th colspan="3"> </th>
<th colspan="5">Header1</th>
<th colspan="5">Header2</th>
<th colspan="5">Header3</th>
<th colspan="5">Header4</th>
<th colspan="5">Header5</th>
<th colspan="5">Header6</th>
<th colspan="5">Header7</th>
<th colspan="5">Header8</th>
<th colspan="5">Header9</th>
<th colspan="5">Header10</th>
<th colspan="5">Header11</th>
<th colspan="5">Header12</th>
<th colspan="5">Header13</th>
<th colspan="5">Header14</th></tr></thead>
<tbody>
<tr class="headerRow">
<td colspan="3"> </td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
<td>SubCol1</td>
<td>SubCol2</td>
<td>SubCol3</td>
<td>SubCol4</td>
<td>SubCol5</td>
</tr>
<tr class="even">
<td>Channel</td>
<td>Grouping</td>
<td>Level</td>
<td colspan="70"> </td></tr>
<tr class="dataRow" >
<td>Header1</td>
<td>Positive</td>
<td>Different LF</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>2</td></tr></tbody></table>
The html appears in Chrome as:
The html appears in email as given below. Notice that columns under Header 13 and 14 are joined into one big column in the email version. Please note that when I reduce the number of column, it start appearing correctly in the email version. Do html tables in emails have any columns limit?
Two issues I see with this:
No email client will safely or appropriately render that many cells. It's way too long and it's wider than the majority of emails clients can handle in their preview windows.
I don't think tables are being used in the most appropriate way to display your information. Whether it be changing the layout you're using to be more vertical, using another format to display this information or just not using tables at all and going for another simplified approach.
I'll leave point 2 up to you to think over but here is what I'd do to simplify the structure of your tables and potentially avoid the issues you're seeing.
<table border=1>
<tbody>
<tr>
<td valign="top">
<table border=1>
<tr>
<th colspan="3"> </th>
</tr>
<tr><td colspan="3"> </td></tr>
<tr class="even">
<td>Channel</td>
<td>Grouping</td>
<td>Level</td>
</tr>
<tr class="even">
<td>Header1</td>
<td>Positive</td>
<td>Different LF</td>
</tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header1</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header2</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header3</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header4</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header5</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header6</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header7</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header8</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header9</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header10</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header11</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header12</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header13</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td></tr>
</table>
</td>
<td valign="top">
<table border=1>
<tr>
<th colspan="5">Header14</th>
</tr>
<tr><td>SubCol1</td><td>SubCol2</td><td>SubCol3</td><td>SubCol4</td><td>SubCol5</td></tr>
<tr><td colspan="5"> </td></tr>
<tr><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td></tr>
</table>
</td>
</tr>
</tbody>
</table

Loop to scrape multiple elements on the same page while storing them separately

I wish to scrape multiple product names from a single page while using Scrapy
<!-- body_text //-->
<td width="601" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td class="pageHeading">Pool (Pocket Billiards) Table</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td class="main">A Victoria table is more than mere wood and slate. By paying attention to the details - the hidden differences - Victoria tables have become known name as masterpieces of original design and craftmanship, and most prestigious name in billiards.<br><br>
These tables, available in two sizes 9’ X 4.5’ and 8’ X 4’, are made of frames with selected good quality solid wood and finely crafted rose wood legs with Mahagony polish.<br><br>
Slate Beds used are either Indian Bangalore Black Slate or Imported Slate. Slates are covered with worsted wool cloth optionally from Jupiter (China) or Strachan (West of England cloth, U.K.) to have proper speed, accuracy and responsiveness of the table to spin. Chrome nuts and adjusters are used for leveling. It is surrounded with standard imported vulcanized 'L' shaped or 'V' shaped rubber cushions or Northern Cushions (Made in England) to cause billiard balls to rebound while minimizing the lose of kinetic energy.</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td>
<table cellpadding="4" cellspacing="0" width="100%" border="0" class="product_box">
<tr>
<td width="50%" valign="top" class="product_name" colspan="2"><strong><a name="vs20b"></a>VS-20B</strong></td>
</tr>
</table>
<table cellpadding="4" cellspacing="4" width="100%" border="0" >
<tr>
<td width="60%" valign="top" class="product_text"><ul><li><strong>Size: 9‘ X 4.5‘</strong></li><li>Rose Wood Legs</li><li>Mahgony Polish</li><li>S.B. Frame</li><li><strong>Bangalore Slate</strong></li><li>Standard Accessories</li></ul></td>
<td width="40%" align="center"><img src="images/products/vs-20b.jpg" alt="VS-20B" border="0" width="250px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td>
<table cellpadding="4" cellspacing="0" width="100%" border="0" class="product_box">
<tr>
<td width="50%" valign="top" class="product_name" colspan="2"><strong><a name="vs20b"></a>VS-20C</strong></td>
</tr>
</table>
<table cellpadding="4" cellspacing="4" width="100%" border="0" >
<tr>
<td width="60%" valign="top" class="product_text"><ul><li><strong>Size: 8‘ X 4‘</strong></li><li>Rose Wood Legs</li><li>Mahgony Polish</li><li>S.B. Frame</li><li><strong>Bangalore Slate</strong></li><li>Standard Accessories</li></ul></td>
<td width="40%" align="center"><img src="images/products/vs-20c.jpg" alt="VS-20C" border="0" width="250px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td>
<table cellpadding="4" cellspacing="0" width="100%" border="0" class="product_box">
<tr>
<td width="50%" valign="top" class="product_name" colspan="2"><strong><a name="vs23b"></a>VS-23B</strong></td>
</tr>
</table>
<table cellpadding="4" cellspacing="4" width="100%" border="0" >
<tr>
<td width="60%" valign="top" class="product_text"><ul><li><strong>Size: 9‘ X 4.5‘</strong></li><li>Rose Wood Legs</li><li>Mahgony Polish</li><li>S.A.L. Frame</li><li><strong>Imported Slate</strong></li><li>Standard Accessories</li></ul></td>
<td width="40%" align="center"><img src="images/products/vs-23b.jpg" alt="VS-23B" border="0" width="250px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td>
<table cellpadding="4" cellspacing="0" width="100%" border="0" class="product_box">
<tr>
<td width="50%" valign="top" class="product_name" colspan="2"><strong><a name="vs23b"></a>VS-23C</strong></td>
</tr>
</table>
<table cellpadding="4" cellspacing="4" width="100%" border="0" >
<tr>
<td width="60%" valign="top" class="product_text"><ul><li><strong>Size: 8‘ X 4‘</strong></li><li>Rose Wood Legs</li><li>Mahgony Polish</li><li>S.A.L. Frame</li><li><strong>Imported Slate</strong></li><li>Standard Accessories</li></ul></td>
<td width="40%" align="center"><img src="images/products/vs-23c.jpg" alt="VS-23C" border="0" width="250px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td>
<table cellpadding="4" cellspacing="0" width="100%" border="0" class="product_box">
<tr>
<td width="50%" valign="top" class="product_name" colspan="2"><strong><a name="vs9"></a>VS-9</strong></td>
</tr>
</table>
<table cellpadding="4" cellspacing="4" width="100%" border="0" >
<tr>
<td width="60%" valign="top" class="product_text"><ul><li><strong>Size: 9‘ X 4.5‘</strong></li><li>Auto Ball Return System</li><li>Pro Speed Cloth</li><li>American Pocket Size</li><li>Standard Accessories</li></ul></td>
<td width="40%" align="center"><img src="images/products/vs-9.jpg" alt="VS-9" border="0" width="250px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td>
<table cellpadding="4" cellspacing="0" width="100%" border="0" class="product_box">
<tr>
<td width="50%" valign="top" class="product_name" colspan="2"><strong><a name="vs7"></a>VS-7</strong></td>
</tr>
</table>
<table cellpadding="4" cellspacing="4" width="100%" border="0" >
<tr>
<td width="60%" valign="top" class="product_text"><ul><li><strong>PLAYING AREA : 88" X 44"</strong></li><li><strong>OVERALL SIZE : 98"L X 54" W X 31" H</strong></li><li>Solid oak for top/brand rails, Dark cherry finish</li><li>Rams head solid rubber wood with # 6 leather drop pocket. Easy assembly</li></ul></td>
<td width="40%" align="center"><img src="images/products/vs-7.jpg" alt="VS-7" border="0" width="250px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td>
<table cellpadding="4" cellspacing="0" width="100%" border="0" class="product_box">
<tr>
<td width="50%" valign="top" class="product_name" colspan="2"><strong><a name="vs8"></a>VS-8/Light Oak</strong></td>
</tr>
</table>
<table cellpadding="4" cellspacing="4" width="100%" border="0" >
<tr>
<td width="60%" valign="top" class="product_text"><ul><li><strong>POOL TABLE : 8‘ X 4‘</strong></li><li><strong>PLAYING AREA : 88" X 44"</strong></li><li><strong>OVERALL SIZE : 98" X 54"W X 31"H</strong></li><li>Solid oak for top/brand rails, Light oak finish</li><li>Rams head solid rubber wood with # 6 leather drop pocket, Easy assembly</li></ul></td>
<td width="40%" align="center"><img src="images/products/vs-8.jpg" alt="VS-8/Light Oak" border="0" width="250px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td>
<table cellpadding="4" cellspacing="0" width="100%" border="0" class="product_box">
<tr>
<td width="50%" valign="top" class="product_name" colspan="2"><strong><a name="vs12"></a>VS-12</strong></td>
</tr>
</table>
<table cellpadding="4" cellspacing="4" width="100%" border="0" >
<tr>
<td width="60%" valign="top" class="product_text"><ul><li><strong>POOL TABLE : 8‘ X 4‘</strong></li><li><strong>PLAYING AREA : 88" X 44"</strong></li><li><strong>OVERALL SIZE : 99-3/4"L X 55 - 3/4" W X 31" H</strong></li><li>Black laminate, pedestal legs, with drop pocket, Steel frame Easy assembly. Accessories included.</li></ul></td>
<td width="40%" align="center"><img src="images/products/vs-12.jpg" alt="VS-12" border="0" width="250px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td>
<table cellpadding="4" cellspacing="0" width="100%" border="0" class="product_box">
<tr>
<td width="50%" valign="top" class="product_name" colspan="2"><strong><a name="vs10"></a>VS-10</strong></td>
</tr>
</table>
<table cellpadding="4" cellspacing="4" width="100%" border="0" >
<tr>
<td width="60%" valign="top" class="product_text"><ul><li><strong>POOL TABLE : 8‘ X 4‘</strong></li><li><strong>PLAYING AREA : 88" X 44"</strong></li><li><strong>OVERALL SIZE : 98" L X 54"W X 31"H</strong></li><li>Solid oak for top/brand rails, oak finish</li><li>Rams head solid rubber wood with # 6 leather drop pocket, Easy assembly</li></ul></td>
<td width="40%" align="center"><img src="images/products/vs-10.jpg" alt="VS-10" border="0" width="250px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td>
<table cellpadding="4" cellspacing="0" width="100%" border="0" class="product_box">
<tr>
<td width="50%" valign="top" class="product_name" colspan="2"><strong><a name="vs11"></a>VS-11</strong></td>
</tr>
</table>
<table cellpadding="4" cellspacing="4" width="100%" border="0" >
<tr>
<td width="60%" valign="top" class="product_text"><ul><li><strong>POOL TABLE : 8‘ X 4‘</strong></li><li><strong>PLAYING AREA : 88" X 44"</strong></li><li><strong>OVERALL SIZE : 100" X 56"</strong></li><li>Solid wood for top/brand rails</li><li>Mahogany finish</li><li>Rams head solid rubber with # 6 leather drop pocket</li></ul></td>
<td width="40%" align="center"><img src="images/products/vs-11.jpg" alt="VS-11" border="0" width="250px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td>
<table cellpadding="4" cellspacing="0" width="100%" border="0" class="product_box">
<tr>
<td width="50%" valign="top" class="product_name" colspan="2"><strong><a name="vs13"></a>VS-13</strong></td>
</tr>
</table>
<table cellpadding="4" cellspacing="4" width="100%" border="0" >
<tr>
<td width="60%" valign="top" class="product_text"><ul><li><strong>POOL TABLE : 8‘ X 4‘</strong></li><li><strong>PLAYING AREA : 88" X 44"</strong></li><li><strong>OVERALL SIZE : 100" X 56"</strong></li><li>Solid wood for top/brand rails,</li><li>Dark cherry finish</li><li>Rams head solid rubber wood<br />
<br />
with # 6 leather drop pocket</li></ul></td>
<td width="40%" align="center"><img src="images/products/vs-13.jpg" alt="VS-13" border="0" width="250px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td>
<table cellpadding="4" cellspacing="0" width="100%" border="0">
<tr>
<td width="50%" valign="top" class="product_name1" colspan="2"><strong>Standard Accessories for Pool</strong></td>
</tr>
</table>
<table cellpadding="4" cellspacing="4" width="100%" border="0" class="product_box1">
<tr>
<td width="50%" valign="top" class="product_text">
<ul>
<li>Aramith Pool Ball 2.1/4" or 2.1/16"</li>
<li>Table Brush</li>
<li>60" Rest Stick C/W Brass Cross Head Rest</li>
<li>Wall Cue Rack</li>
</ul></td>
<td width="50%" valign="top" class="product_text">
<ul>
<li>Plastic Triangle</li>
<li>Triangle Chalk X 12 Pcs.</li>
<li>Pool House Cue X 4 Pcs.</li>
<li>Table Cover</li>
<li>Round Type Lamp Shade X 2 Pcs.</li>
</ul></td>
</tr>
</table>
</td>
</tr>
</table></td>
<!-- body_text_eof //-->
<td width="45" valign="top">
<table border="0" width="45" cellspacing="0" cellpadding="0">
<!-- right_navigation //-->
As you can see from the code, the are fields which I want to scrape_ which are at the xpath: td[#class='product_name']/strong/a/#name
I also need to pull the images as well from this xpath: rd[#align='center']/a/img/#src
I'm exporting my data in CSV and Currently my scraper stores all the product names in one cell. I'm trying to make it such that it stores each product name and the image URL individually in a single cell in my CSV.
I tried using a loop for this but can't make it to work
My Code:
def parse(self, response):
hxs = HtmlXPathSelector(response)
titles = hxs.select("//head")
items = []
item = item()
for i in range(0,5):
item ["productname"] = titles.select("//td[#class='product_name'][i]/strong").extract()
item ["imgurl"] = titles.select("//td[#align='center'][i]/a/img/#src").extract()
items.append(item)
return(items)
names = hxs.xpath('//td[#class="product_name"]/strong/text()')
imageurls = hxs.xpath('//tr/td[#align="center"]/a/img/#src')
for name, url in zip(names, imageurls):
item["productname"] = name
item["imgurl"] = url
yield item
Simplest way of doing it since the order of the names and image urls would correspond with each other when they are extracted.
You don't need to select the elements one by one (by changing the i index in a loop as you did). The path expression below:
//td[#class='product_name']/strong/a/#name
already returns a node-set containing two items. You just have to loop over the elements that were returned to extract each attribute string.
As for the second expression:
//td[#align='center']/a/img/#src
there is only one match and you could extract the string directly.

How to create a two column email newsletter

I am trying to create a two column email flyer but I'm having trouble with the coding as Outlook hates CSS.
I'm using tables to keep it as simple as possible but I want two separate tables on the left and the right so I can add data into it as I wish.
I tried using float left and right on the two tables but Outlook ignores this style.
I know the two grey tables at the bottom are each in their own separate "holder" tables but this is so I can duplicate the grey "data" tables for when I add new articles.
<table class="all" width="auto" height="auto" border="0" cellspacing="0"><tr><td height="504">
<table width="750" height="140" border="0" cellspacing="0">
<tr>
<td width="200" valign="bottom" bgcolor="#E6E6E6"> </td>
<td width="345" align="center" valign="bottom" bgcolor="#E6E6E6"> </td>
<td width="152" align="center" valign="bottom" bgcolor="#E6E6E6"> </td>
<td width="45" align="center" valign="bottom" bgcolor="#E6E6E6"> </td>
</tr>
<tr>
<td width="200" valign="bottom" bgcolor="#E6E6E6"> </td>
<td align="center" valign="bottom" bgcolor="#E6E6E6"><font color="#111111" face="Arial Narrow" size="+2">DECEMBER NEWSLETTER</font></td>
<td width="152" align="center" valign="bottom" bgcolor="#E6E6E6"><font size="2"><strong>#4 - <span class="orange">04.12.13</span></strong></font></td>
<td width="45" align="center" valign="bottom" bgcolor="#E6E6E6"> </td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="75" height="50" bgcolor="#E6E6E6" scope="row"> </td>
<td width="600" rowspan="2" scope="row"><img src="http://placehold.it/600x200"/></td>
<td width="75" bgcolor="#E6E6E6" scope="row"> </td>
</tr>
<tr>
<td width="75" height="81" scope="row"> </td>
<td scope="row"> </td>
</tr>
</table>
<table class="holder" width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" scope="row">
<table class="inlinetableleft" width="360">
<tr>
<td width="371" align="left">
<!------------LEFT COLUMN------------------>
<table width="360" border="0" cellspacing="0" cellpadding="0">
<tr>
<th height="103" colspan="4" align="left" valign="middle" bgcolor="#CCCCCC" scope="row"> </th>
</tr>
</table>
<!--------------LEFT COLUMN END------------->
</td>
</tr>
</table>
<table class="inlinetableright" width="360">
<tr>
<td align="left">
<!------------RIGHT COLUMN------------------>
<table width="360" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="106" align="left" bgcolor="#CCCCCC" scope="row"> </td>
</tr>
</table>
<!-----------RIGHT COLUMN END-------------->
</td></tr>
</table>
</td>
</tr>
</table>
Here is a fiddle of my newsletter so far, it's the bottom two grey tables that I want to be side by side.
Fiddle
For HTML emails, nested tables are your friend :)
JSFiddle
Note: the border around the table is just to show you where the tables are.
<table border="0" width="600" cellpadding="0" cellspacing="0" align="center">
<tr>
<td colspan="2">
header content here
</td>
</tr>
<tr>
<td width="300">
<table border="0" width="300" cellpadding="1" cellspacing="0" align="left">
<tr>
<td>Left Content</td>
</tr>
</table>
</td>
<td width="300">
<table border="0" width="300" cellpadding="1" cellspacing="0" align="left">
<tr>
<td>Right content</td>
</tr>
</table>
</td>
</tr>
</table>

HTML Agility Pack xpath expression assistance

I have html like the following:
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="2">
<tr>
<td height="20" colspan="2">
</td>
</tr>
<tr>
<td height="20" colspan="2" class="fontDestaque2NegritoHome">
MATRÍCULA: PPAAG
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
</td>
<td align="right" valign="middle" class="tx_bd">
</td>
</tr>
<tr>
<td width="35%" align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Fabricante:</span>
</div>
</td>
<td width="59%" align="right" valign="middle" class="tx_bd">
<div align="left">
CESSNA AIRCRAFT</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Modelo:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
T206H</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Número de Série:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
T20608735</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left" class="tx_bold">
Tipo ICAO :
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
C206</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Tipo de Habilitação para Pilotos:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
MNTE</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Classe da Aeronave:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
POUSO CONVECIONAL 1 MOTOR CONVENCIONAL</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Peso Máximo de Decolagem:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
1633 - Kg</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Número Máximo de Passageiros:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
005</div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" class="tx_bd">
<div align="left">
</div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" background="../images/bgPontilhado.gif"
class="tx_bd">
<div align="left">
<img src="../images/bgPontilhado.gif" width="4" height="1"></div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" class="tx_bd">
<div align="left">
</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Categoria de Registro:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
PRIVADA SERVICO AEREO PRIVADOS</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Número dos Certificados (CM - CA)</span>:
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
19040</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Situação no RAB:</span><span class="stop_litle">
</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="fontRed">ARRENDAMENTO OPERACIONAL/ALIENACAO FIDUCIARIA</span></div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Data da Compra/Transferência:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
</div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" class="tx_bd">
<div align="left">
</div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" background="../images/bgPontilhado.gif"
class="tx_bd">
<div align="left">
<img src="../images/bgPontilhado.gif" width="4" height="1"></div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" class="tx_bd">
<div align="left">
</div>
</td>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Data de Validade do CA: </span>
</div>
</td>
<td width="3%" align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bd">21/05/16</span></div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left" class="tx_bold">
<div align="left">
Data de Validade da IAM:
</div>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bd">110513</span></div>
</td>
</tr>
<tr>
<td height="18" align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Situação de Aeronavegabilidade:</span>
</div>
</td>
<td height="18" align="right" valign="middle" class="tx_bd">
<div align="left">
Normal</div>
</td>
</tr>
<tr>
<td height="18" colspan="2" align="right" valign="middle" class="tx_bd">
<div align="left" class="tx_bold">
Motivo(s):
</div>
</td>
</tr>
<tr>
<td height="18" colspan="2" align="right" valign="middle" class="tx_bd">
<div align="left">
<blockquote>
<p>
<span class="tx_bold"></span>
</p>
</blockquote>
</div>
</td>
</tr>
<tr>
<td height="18" colspan="2" align="left" valign="middle" class="tx_bd">
Consulta realizada em: 16/8/2012 15:52:45<br>
</td>
</tr>
I want to grab the following text:
Cessna Aircraft
T206H
T20608735
C206
MNTE
POUSO CONVECIONAL 1 MOTOR CONVENCIONAL
1633 - Kg
005
PRIVADA SERVICO AEREO PRIVADOS
19040
ARRENDAMENTO OPERACIONAL/ALIENACAO FIDUCIARIA
21/05/16
110513
Normal
Some of the div's just contain the text I need. Other div's contain a span that contains the text I need. How would I construct the xpath for this?
Use:
//tr/td[#align='right' and #valign='middle' and #class='tx_bd']
/div[#align='left 'and not(*)]
/text()

Top-align nodes

Problem
The following image shows an organization chart:
The Full Name boxes are aligned along their centre. The desired layout, however, aligns the boxes along the top:
Source Code
The code for the graph is as follows:
digraph G {
fixedwidth = true;
node [
shape="box",
style="rounded",
penwidth = 1,
width=2.0,
fontname = "Arial",
fontsize = 12
];
edge [
color="#142b30",
arrowhead="vee",
arrowsize=0.75,
penwidth = 2,
weight=1.0
];
A1 [ label = <
<TABLE BORDER="0" CELLSPACING="5">
<TR>
<TD><FONT POINT-SIZE="16">Top Level</FONT></TD>
</TR>
<TR>
<TD><FONT POINT-SIZE="18">Owner</FONT></TD>
</TR>
</TABLE>>
];
B3 [ label = <
<TABLE BORDER="0" CELLSPACING="5">
<TR>
<TD><FONT POINT-SIZE="12">Second Level<BR/>(1)</FONT></TD>
</TR>
<TR>
<TD><FONT POINT-SIZE="14">Owner</FONT></TD>
</TR>
</TABLE>>
];
B4 [ label = <
<TABLE BORDER="0" CELLSPACING="5">
<TR>
<TD><FONT POINT-SIZE="12">Second Level<BR/>(2)</FONT></TD>
</TR>
<TR>
<TD><FONT POINT-SIZE="14">Owner</FONT></TD>
</TR>
</TABLE>>
];
B5 [ label = <
<TABLE BORDER="0" CELLSPACING="5">
<TR>
<TD><FONT POINT-SIZE="12">Second Level<BR/>(3)</FONT></TD>
</TR>
<TR>
<TD><FONT POINT-SIZE="14">Owner</FONT></TD>
</TR>
</TABLE>>
];
B6 [ label = <
<TABLE BORDER="0" CELLSPACING="5">
<TR>
<TD><FONT POINT-SIZE="12">Second Level<BR/>(4)</FONT></TD>
</TR>
<TR>
<TD><FONT POINT-SIZE="14">Owner</FONT></TD>
</TR>
</TABLE>>
];
C4 [ label = <
<TABLE BORDER="0" CELLPADDING="0" ALIGN="LEFT">
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
</TABLE>>
];
C5 [ label = <
<TABLE BORDER="0" CELLPADDING="0" ALIGN="LEFT">
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
</TABLE>>
];
C6 [ label = <
<TABLE BORDER="0" CELLPADDING="0" ALIGN="LEFT">
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
</TABLE>>
];
C7 [ label = <
<TABLE BORDER="0" CELLPADDING="0" ALIGN="LEFT">
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
<TR>
<TD ALIGN="LEFT"><FONT POINT-SIZE="10">Full Name</FONT></TD>
</TR>
</TABLE>>
];
{ rank = same; B3; B4; B5; B6; }
A1 -> B3:n;
A1 -> B4:n;
A1 -> B5:n;
A1 -> B6:n;
{ rank = same; C4; C5; C6; C7; }
B3 -> C4;
B4 -> C5;
B5 -> C6;
B6 -> C7;
}
Question
How would you align the Full Name boxes along the top?
Thank you!
Probably not exactly what you are looking for but you can set the height of the boxes to be the same (by using fixedsize=true,height="some number" then you can have the text be centered in the middle (by default). So adding the following lines:
C4 [fixedsize=true,height=2];
C5 [fixedsize=true,height=2];
C6 [fixedsize=true,height=2];
C7 [fixedsize=true,height=2];
would result in:
This is basically the same question as:
graphviz: left/right align nodes instead of centering?
Unfortunately, although I've been using Graphviz for about 8 years, I'm not sure how to accomplish what you want.

Resources