HTML Code not centred with page?
Autor: David W.
Visitado 2452,
Seguidores 2,
Compartilhado 0
Hi,
Hope smeone can help.
I have a page with a two entries, a standard text section and a HTML code section.
When I display the page the page is centred on the screen (inlcuding the top text section) but the HTML code is left justified.
I'm just using an HTML table
<table>
<tbody >
<tr>
<th style="WIDTH: 8%">
<p>TIN</p>
</th>
This used to work under earlier versions
Many thanks in advance
Dave
Publicado em
try:
<table align="center" style="margin: 0px auto;">
<tbody >
<tr>
<th style="WIDTH: 8%">
<p>TIN</p>
</th>
</tr>
</tbody>
</table>
Autor
Hi Andre,
Thanks for the quick reply, but that doesn't work. I've added a screen shot below.
Thanks
Dave
it shout, did you enter all the code also the last tags? I missed some in your post.
Check also the style button of the object is this also centered?
If it still does not work;
Can you post the full code you are using now?
Is there also a reason why you don't use the table of x5?
Else you can try:
<center>
<table>
<tbody >
<tr>
<th style="WIDTH: 8%">
<p>TIN</p>
</th>
</tr>
</tbody>
</table>
</center>
But the best way is to set this in the css part of the html page;
table { margin-left:auto; margin-right:auto;}
you can find the css part in the expert tab of the html object.
Goodluck!
Autor
Hi Andre,
Yes I entered all the code. The bit of code I added to the first post was just the first few lines, so I already had the last tags. I've added the HTML below, although note I've removed a chuck which is repeating.
I'm not sure what you mean by "style button" - I haven't changed anything from X5 V12 and it worked with that version.
I guess I didn't use tabel in X5 becase I can't remember seeing a table option in the first version I used.
I have another page where it exhibits the same problem, but then another one that doesn't
Code::::
<table align="center" style="margin: 0px auto;">
<tbody >
<tr>
<th style="WIDTH: 8%">
<p>TIN</p>
</th>
<th style="WIDTH: 8%">
<p>Date</p>
</th>
<th style="WIDTH: 35%">
<p>Title</p>
</th>
<th style="WIDTH: 7%">
<p>Read</p>
</th>
<th style="WIDTH: 43%">
<p>Key Words</p>
</th>
</tr>
<tr style="background-color: #c0c0c0">
<td>
TIN001
</td>
<td>
Jul 12
</td>
<td>
<p>TickITplus and Requirements Standards</p>
</td>
<td>
<script type='text/javascript' src='http://dstats.net/dstatsjs.php?file=http://www.omniprove.co.uk/custom-1/TIN001-1207%20v1r0.pdf'>
<script type='text/javascript'>document.write(dsCounter);</script>
</td>
<td>
<p>Base Process Library (BPL), Requirement Standards</p>
</td>
</tr>
<tr>
<td>
<a href= "http://dstats.net/download/TIN001" target="_blank" rel="nofollow">http://www.omniprove.co.uk/custom-1/TIN001-1207%20v1r1.pdf">TIN001
</td>
<td>
</td>
<td>
<font color="#ff0000">Updated to v1r1 to correct CSR reference error</font>
</td>
<td>
<script type='text/javascript' src='http://dstats.net/dstatsjs.php?file=http://www.omniprove.co.uk/custom-1/TIN001-1207%20v1r1.pdf'>
<script type='text/javascript'>document.write(dsCounter);</script>
</td>
<td>
Base Process Library (BPL), Requirement Standards
</td>
</tr>
......there is a lot of duplication in here which I've removed........
</tbody>
</table>
Autor
Hi Andre,
Using <center></center> gives
Autor
Hi,
Ok, so I've found that it is something to do with two factors;
1. I have two rows, first row text and second row HTML code
2. The Experst Style has:
<style>
table
{
}
th
{
background-color:#9adeff;
font-weight:Normal;
font-size:11pt;
line-height:1.5em;
text-align: left;
vertical-align: middle;
border-style:double;
border-color: #C8C8C8;
border-width:1px;
padding:3px;
}
td
{
font-weight:normal;
font-size:10pt;
line-height:1.5em;
text-align: left;
vertical-align: middle;
border-style:double;
border-color: #C8C8C8;
border-width:1px;
padding:3px;
}
</style>
When I remove the Expert style it goes back to the centre, but obviously isn't formatted as I want it.
I have another page with the same expert style in it, but the layout of this page is different and it works fine. The layout is:
6 rows as follows:
Row 1: HTML Code
Row 2: Two columns made up of Text column 1 and HTML code column 2 <- this cell has the same style and works fine
Row 3: Text
Row 4: HTML Code
Row 5: Text
Row 6 : HTML Code
Thoughts anyone?
Thanks
Autor
Hi
Further update - maybe BUG
It would appear that if I then add a third row with a blank text box in it, it works correctly............
Try to copy the page, and see if the copy works better, if so then delete the original one and rename the copy.
Hi David,
you need remove only the tag <style> and </style>.
Autor
Hi stesil,
Many thanks, that worked perfectly.
Did something change between X5 V12 and V13, becuase it worked fine in V12?
Andre, stesil, thanks again for your help
Dave
Maybe because the two versions (12 and 13) have two different HTML structure. Anyway in both versions, the software writes the CSS code included in the expert tab of an HTML Object in the external file .css. An external style sheet should not contain any HTML tags.
I'm sorry for my bad English.