Table colspan and rowspan not working - html

I'm working on table for design its simple table but its not working for me, here is the design what I want:
and my code is changing after every mins for this output but didn't succeed. Code is
See the [fiddle](http://jsfiddle.net/su4w3ymx/1/)
I updated my code now I'm creating it but now when I want to add notify party in third row it's messing up.

See the fiddle
HTML
<table cellpadding="0" cellspacing="0" width="100%" border="1">
<tr>
<td rowspan="3">SHIPPER/EXPORTER
<br />W8SHIPPING
<br />8 AVIATION CT, Savannah U.S.A.
<br />GA 31408
<br />TEL: +1 912 966 6820</td>
</tr>
<tr>
<td colspan="2">BOOKING NUMBER</td>
</tr>
<tr>
<td colspan="2">EXPORTER REFERENCES</td>
</tr>
</table>
UPDATE 1
Check the fiddle
UPDATE 2
Check the fiddle
UPDATE 3
Check the fiddle if you want to see the full structure created

<table cellpadding="0" cellspacing="0" width="100%" border="1">
<tr>
<td rowspan="2">SHIPPER/EXPORTER
<br />W8SHIPPING
<br />8 AVIATION CT, Savannah U.S.A.
<br />GA 31408
<br />TEL: +1 912 966 6820</td>
<td>BOOKING NUMBER</td>
</tr>
<tr>
<td rowspan="2">
EXPORTER REFERENCES
</td>
</tr>
</table>

Related

Hide/show 2 table rows when having data

I need to display 2 empty table row when don't have any data and when they do have data those 2 empty table rows should be hidden. Now i can write the code for display data in the table rows but it doesn't display 2 empty table rows when it doesn't have data, so please help me to solve this problem. thank you.
<table class="message_table" width="1025" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#c9c9c9">
<tr style="background-color:#797a7b;">
<td style="color:#fff;">序号</td>
<td style="color:#fff;">模式</td>
<td style="color:#fff;">时时彩返点</td>
<td style="color:#fff;">11选5返点</td>
<td style="color:#fff;">低频返点</td>
<td style="color:#fff;">操作</td>
</tr>
<a4j:repeat value="#{AgentAutoRegBean.reslist}" var="list"
id="dblist" rowKeyVar="keys">
<tr style="background:#{keys%2==1?'#EEEEDD':'#f4f4f4'}">
<td>#{keys+1}</td>
<td>#{list.model}</td>
<td>
<h:outputText value="#{list.pointssc}" converter="PercentConverter"/>
</td>
<td>
<h:outputText value="#{list.point115}" converter="PercentConverter"/>
</td>
<td>
<h:outputText value="#{list.pointdp}" converter="PercentConverter"/>
</td>
<td>
<font color="#5a5a5a">
<a4j:commandLink value="编辑" status="normalStatus" action="#{AgentAutoRegBean.edit}" data="#{AgentAutoRegBean.msg}" oncomplete="edit01(data)">
<f:param name="sign" value="#{list.sign}"/>
</a4j:commandLink>
<rich:spacer width="8"></rich:spacer>
<a4j:commandLink value="网址" onclick="winopen('#{list.sign}');return false;">
</a4j:commandLink>
</font>
</td>
</tr>
</a4j:repeat>
</table>
If you want to fill it later you have to use the var attribute of the a4j:repeat and prepare a list with 2 (empty) elements in the backing bean before access the data and use listeners for fill the list later.

how to create html table in fpdf

I am newbie.
I have a problem how to convert html table with fpdf.
This is my html code
<html>
<body>
<table border=1 align=center>
<tr>
<tr>
<td> </td>
<td>PO1</td>
<td>PO2</td>
</tr>
<tr>
<td>LO1</td>
<td> "THIS WILL TAKE THE VALUE FROM DATABASE " </td>
<td> "THIS WILL TAKE THE VALUE FROM DATABASE " </td>
</tr>
<tr>
<td>LO2</td>
<td> "THIS WILL TAKE THE VALUE FROM DATABASE " </td>
<td> "THIS WILL TAKE THE VALUE FROM DATABASE " </td>
</tr>
</table>
</body>
</html>
Can anyone tell me how to do it?
please take a look the example at http://www.fpdf.org/en/script/script41.php

string replace in phpmyadmin while keeping inner text

i need to change quite some html entries in a mysql database. my problem is that some tags need to be replaced while the surrounded code needs to stay the same. in detail: all td-tags in tr-tags with the class "kopf" need to be changed to th-tags (and the addording closing for the tags)
it would not be a problem without the closing tags..
update `tt_content` set `bodytext` = replace(`bodytext`,'<tr class="kopf"><td colspan="2">','<tr><th colspan="2">');
this would work
from what i found the %-sign is used, but how exactly?:
update `tt_content` set `bodytext` = replace(`bodytext`,'<tr class="kopf"><td colspan="2">%</td></tr>','<tr><th colspan="2">%</th></tr>');
i guess this would replace all the code within the old td tags by a %-sign?? how can i achive the needed replacement?
edit: just to clarify things here is a possible entry in the db:
<table class="techDat" > <tbody> <tr class="kopf"> <td colspan="2"> <p><strong>Technical data:</strong></p> </td> </tr> <tr> <td> <p>Operating time depending on battery chargeBetriebszeit je Akkuladung</p> </td> <td> <p>Approx. 4 h</p> </td> </tr> <tr> <td> <p>Maximum volume</p> </td> <td> <p>Approx. 120 dB(A)</p> </td> </tr> <tr> <td> <p>Weight</p> </td> <td> <p>Approx. 59 g</p> </td> </tr> </tbody> </table>
after the mysql replacement it should look like
<table class="techDat" > <tbody> <tr> <th colspan="2"> <p><strong>Technical data:</strong></p> </th> </tr> <tr> <td> <p>Operating time depending on battery chargeBetriebszeit je Akkuladung</p> </td> <td> <p>Approx. 4 h</p> </td> </tr> <tr> <td> <p>Maximum volume</p> </td> <td> <p>Approx. 120 dB(A)</p> </td> </tr> <tr> <td> <p>Weight</p> </td> <td> <p>Approx. 59 g</p> </td> </tr> </tbody> </table>
Try two replaces
update `tt_content` set `bodytext` =
replace(replace(`bodytext`,
'<tr class="kopf"><td colspan="2">','<tr><th colspan="2">'),
'</td></tr>','</th></tr>')
Try updating your records with two queries :
1) for without % sign:
updatett_contentsetbodytext= replace(bodytext,'<tr class="kopf"><td colspan="2">','<tr><th colspan="2">');
2) for % sign
updatett_contentsetbodytext= replace(bodytext,'<tr class="kopf"><td colspan="2">%</td></tr>','<tr><th colspan="2">%</th></tr>')
where instr(bodytext,'%') > 0 ;

Table cell too wide

Please, either look at http://jsfiddle.net/mawg/pL9kd/ or stick the code below into your favourite HTML editor ...
Look to the right of OMG! Item 4 contains a *nested* array. (How) can I get that nested array (xyz) to be 2 columns wide, even if its content doesn't need so much space?
<table border="1" cellpsacing="0" cellpadding="0" style="">
<tr><th style="border-width:1" colspan="3">This is an array</th></tr>
<td colspan="2">
<table border="1">
<tr><td colspan="3">Array</td></tr>
<tr>
<td>item 1</td>
<td>string ( 3 chars)</td>
<td>abc</td>
</tr>
<tr>
<td>0</td>
<td>string ( 25 chars)</td>
<td>item 2 is indexed by zer0</td>
</tr>
<tr>
<td>this equals seven</td>
<td>integer</td>
<td>7</td>
</tr>
<tr>
<td>item 4 is a nested array</td>
<td colspan="2">
<table border="1">
<tr><td colspan="3">Array</td></tr>
<tr>
<td>0</td>
<td>string ( 24 chars)</td>
<td>item 4, offest 0's value</td>
</tr>
<tr>
<td>OMG! Item 4 contains a *nested* array F5</td>
<td colspan="2">
<table border="1">
<tr><td colspan="3">Array</td></tr>
<tr>
<td>xyz</td>
<td>string ( 7 chars)</td>
<td>xyz val</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>item 4, offest 2 is True</td>
<td>boolean</td>
<td>True</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>final item</td>
<td colspan="2">NULL</td>
</tr>
</table>
</td>
</table>
Do you mean like this? http://jsfiddle.net/pL9kd/8/
(Width = 100%)
Check this you can use the width, to set to width='66%' which works since you know there are 3 columns and 2/3 is 66%. Also set the containing table to width='100%' since you are going to need all of the possible space.
From what I could find there is nothing like what your asking (or at least my interpretation of it). Could you not simply create a column width equaling two total columns?
So something like
<td width="40">xyz</td>
I could be way off but that's just my guess. Just curious, what is the implementation for this? I am sure you know css lists and other css elements are much more efficient at styling, correct?

Using ruby and nokogiri to parsing HTML using HTML comments as markers

How could I use ruby to extract information from a table consisting of these rows? Is it possible to detect the comments using nokogiri?
<!-- Begin Topic Entry 4134 -->
<tr>
<td align="center" class="row2"><image src='style_images/ip.boardpr/f_norm.gif' border='0' alt='New Posts' /></td>
<td align="center" width="3%" class="row1"> </td>
<td class="row2">
<table class='ipbtable' cellspacing="0">
<tr>
<td valign="middle"><alink href='http://www.xxx.com/index.php?showtopic=4134&view=getnewpost'><image src='style_images/ip.boardpr/newpost.gif' border='0' alt='Goto last unread' title='Goto last unread' hspace=2></a></td>
<td width="100%">
<div style='float:right'></div>
<div> <alink href="http://www.xxx.com/index.php?showtopic=4134&hl=">EXTRACT LINK 1</a> </div>
</td>
</tr>
</table>
<span class="desc">EXTRACT DESCRIPTION</span>
</td>
<td class="row2" width="15%"><span class="forumdesc"><alink href="http://www.xxx.com/index.php?showforum=19" title="Living">EXTRACT LINK 2</a></span></td>
<td align="center" class="row1" width='10%'><alink href='http://www.xxx.com/index.php?showuser=1642'>Mr P</a></td>
<td align="center" class="row2"><alink href="javascript:who_posted(4134);">1</a></td>
<td align="center" class="row1">46</td>
<td class="row1"><span class="desc">Today, 12:04 AM<br /><alink href="http://www.xxx.com/index.php?showtopic=4134&view=getlastpost">Last post by:</a> <b><alink href='http://www.xxx.com/index.php?showuser=1649'>underft</a></b></span></td>
</tr>
<!-- End Topic Entry 4134 -->
-->
Try to use xpath instead:
html_doc = Nokogiri::HTML("<html><body><!-- Begin Topic Entry 4134 --></body></html>")
html_doc.xpath('//comment()')
You could implement a Nokogiri SAX Parser. This is done faster than it might seem at first sight. You get events for Elements, Attributes and Comments.
Within your parser, your should rememeber the state, like #currently_interested = true to know which parts to rememeber and which not.